I have a couple of columns in jqGrid with edittype="select". How can I read the option value of the value currently selected in a particular row?
e.g.: When I provide the following option, how do I get "FE" for FedEx, etc.
editoption: { value: “FE:FedEx; IN:InTime; TN:TNT” }
getRowData() for the rowId/cellname returns only the text/displayed component of the select.
If I set a "change" data event on the column, the underlying fires change events only on mouse clicks, and not keyboard selects (there's numerous references to generic selects and mouse/keyboard issues).
Bottomline, when a new value is selected, I need to know the option value at the time of the change, and also prior to posting to the server.
How to get a cell value in JQGrid? var ret = jQuery("#MyGrid"). jqGrid('getRowData', id); ret = ret.
jQuery grid with row selections. Rows can be selected in ParamQuery Grid either by user action or programmatically. All rows can be selected using Ctrl - A or Cmd - A (Mac).
In a nutshell, colNames defines the names of your jqGrid columns on the page, and colModel specifies options for each column (name in the dataset, width, etc). The documentation has more information: colModel Array which describes the parameters of the columns. This is the most important part of the grid.
You have to set the formatter of the column to 'select'
Example from the wiki:
colModel : [ {name:'myname', edittype:'select', formatter:'select', editoptions:{value:"1:One;2:Two"}} ... ]
See more here jqgridwiki
I was having the same problem and this worked like a charm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With