I need to dinamically build combos. I’m using dataUrl & buildSelect properties. I can’t use formatter:”select” since it doesn’t work out of the box with dynamic selects. Oleg kindly provide me an example to pass this limitation, which consists in using beforeProcessing to map the values for the combos before the grid is filled with data. The downside with this approach is that I must rewrite all my web methods to “append” the data to load the combos to the normal data used to fill the grid.
I have a lot of grids and I also have a class that converts the datatable response to a jqgrid object.
Before modifying all my web methods I found another way to achieve what I want:
1) I retrieve the text instead of the value for every cell that is mapped to a combo.
2) When opening the edit form jqgrid will match that text to the correct option in the combo.
3) After a successfull submit (id of the combo is used) I use afterSubmit event to replace the id with the corresponding text so it will be displayed correctly in the grid.
Everything Works well, but before I change all the grids I want to know if I’m making a “good use” of the features of jqgrid.
If someone could give me an advice it would be great, since I don’t want to use something that works now but since is not “strictly” correct code may be altered or removed in the future.
Please also notice (I already reported this in the bugs section) that every time the edit form is opened the ajax url is used to fill the combo.
here’ the corresponding jsfiddle:
http://jsfiddle.net/n4aeg1g4/
Thanks in advance.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top