The default value works for adding row. If you are in edit mode the value that is in the grid is selected in the edit form. If the value can not be found (i.e. there are differences in the grid data and the definitions in editoptions) the first value is used. In order to do what you want in edit mode you maybe will need to use beforeShowForm event.
The default value works for adding row. If you are in edit mode the value that is in the grid is selected in the edit form. If the value can not be found (i.e. there are differences in the grid data and the definitions in editoptions) the first value is used. In order to do what you want in edit mode you maybe will need to use beforeShowForm event.
Regards
Tony
maybe i can save someone for tearing his hairs out…….
in my case….(in form editing: select value forgot his grid-value and showed first-select value…)
I have a similar problem : I use a grid and the edit form option. The first time I edit a line in my form I have the GET request which ask the server for the select values => the 1st value is selected by default (and not the current row value). If I close the form and click again on edit => no more Get as select values are kept in memory (recreateForm false by default) and now the default value in the select is OK, and this for all rows I want to edit.
If I set property recreateForm to true => I have a get on the server to get select values each time => the select in the form have by default the 1st value in the list (which is wrong), even if I close and edit again.
My conclusion (on my code here) is that each time there is a get for select value on the server the default value is wrong (the 1st in the list). If we keep this list in memory then all other edition will have correct default value (mean the current value of the row).
On Safari the select have no default value => white, but closing the form and re-editing is ok.
On Opera I have the 1st value by default each time, even if the list is not recreated….
Also my select is like this :
1
<br/>crystalquick_rw<br/>corning_96<br/><option value</code><code>='4'>corning_192<br />crystalquick_sw_new1<br />crystalquick_sw_new2</code><code><br /><br />In the row showed to users there is not the value 4 but the associated name : </code><code>corning_192, <br />then jqgrid have to deal with the name to find the current value.<br />Maybe this is the cause ?