Forum



11:32

13/04/2012

Hello, I am enjoying jqgrid and nomrally I am able to find the answer to the issues I encounter by searching the web, this time I failed :
I have a grid application that generates dynamically the js code to build the jqgrid object.
Some columns are dcefined as selects, others as normal text, depending on the table I am browsing.
Note : I am using local data (an array) which displays and updates (with some custom made functions for this) fine
The issue is with the search functionality as the list of values is generated dynamically and placed in the editoptions.
I noticved that values showed up in the filtertoolbarf, but not in the form search, so I added searchoptions (also to add an "all" option) dynamically in this way :
var cm = $("#grid1").jqGrid('getGridParam','colModel');
for (var i = 0;i<cm.length;i++)
{
if (cm[i].formatter == "select")
{
var lst = ":All;"+cm[i].editoptions.value;
cm[i].searchoptions = {sopt:['eq','ne'] , value : lst};
}
}
$("#grid1").jqGrid('setGridParam','colModel',cm).trigger("reloadGrid");
I then get again the colmodel and dump it to the chrome console to check that values were set properly, which is the case.
The issues I have are :
1) In the filter toolbar the "all" option is not visible, all the other values are correct for all the columns
2) In the search form the "all" option is visible, but I always get the first field select values regardless of the field I chose (included the text ones, the search text field remains a select also for stype="text" fields.
Any idea?
Thanks
Most Users Ever Online: 715
Currently Online:
85 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66