For example,
{name:'stock', index:'stock', width:60, editable:true, edittype:"checkbox", editoptions: {value:"Yes:No"}},
editable: defines if this field is editable (or not). Default is false. To make a field editable, set this to true: editable:true
edittype: defines the type of of the editable field. Possible values: 'text', 'textarea', 'select', 'checkbox'. The default value is 'text'.
editoptions: an array of allowed options (attributes) for the chosen edittype
Details of edittype and editioptions appear below.
If we are going to save the results of the edit into a server-side database, we also need to specify the server-side method that is going to accept the edited data. This is set as a grid option: editurl
<input type="text" ...../>
editoptions: {size:10, maxlength: 15}
<input type="text" size="10" maxlength="15" />
<input type="text" id="12_invdate" name="invdate" size="10" maxlength="15" value="someval"/>
<input type="textarea" .../>
editoptions: {rows:"2",cols:"10"}
<input type="checkbox" .../>
editoptions: { value:"Yes:No" }
To these attributes jqGrid adds id and name attributes just as for text type.
<select> <option value='val1'> Value1 </option> <option value='val2'> Value2 </option> ... <option value='valn'> ValueN </option> </select>
andcolModel : [ ... {name:'myname', edittype:'select' editoptions:{value:"1:One;2:Two"} } ... ]
are correct and can be used as a 'select' definition.colModel : [ ... {name:'myname', edittype:'select', editoptions:{value:{1:'One',2:'Two'}} } ... ]
Whichever you use, something like the following
will constructeditoption: { value: "FE:FedEx; IN:InTime; TN:TNT" }
<select> <option value='FE'> FedEx </option> <option value='IN'> InTime </option> <option value='TN'> TNT </option> </select>
To this element, jqGrid adds the id and name attributes as above.
Multiple selection of options in a select box is also possible:
editoptions: {multiple:true, ... }