Hi,
I use jqGrid in some table with multiselect. Since I tend to have everything that belongs together in data structures (which are msot of the time seperate files) I did the same with all my grid options. I did my setup in a way:
var gridoptions = {
'grid_1': {url:…,datatype:…},
'grid_2':{….}
}
The problem is: when I use multiselect and open the page again and again, new rows with checkboxes are added all the time. I did a lot of research on this and finally came up with the solution: When the default optiosn and the user options are merged, the function $.extend from jQuery is used. In a normal case, where you specify your options directly in the code (and not like in my case in a seperate data structure) this is fine. But I store everything in my structure, so $.extend manipulates my setup instead of doing it only jqGrid internal. I think it has something to do with my multi-level object structure, but anyway: there is a simple solution: $.extend has another first option, that can be set to true. If this is done (and this is quite well hidden in the documentation), not a simple copy of the data structure is done (which is causing my problems), but a deep copy is done, like a recursive copy. So when I modify the code to $.extend(true,….) everything is working fine.
Long story short: In future versions, please enable deep copy for extend, it keeps me from changing the code every time again when a new version is coming out.
Thank you!
Creativebyte
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top