Home › Forums › Guriddo jqGrid JS › Help › filterGrid: initialize filter model
Hi,
I use the filterGrid with the filterModel and the type of the columns is 'select'. This work fine.
Between two reload of the data, I would like to
Hello,
You can use afterSearch event (see docs) something like
// I suppose you name for the select is myselect
afterSearch : function () {
jQuery(“select[@name=myselect]”,”#filterelem”).empty();
// here your code to add new options.
}
Regrds
Tony
Thank's Tony.
I always have a problem.
There is a form with a grid, input fields and submit button to select the content of the grid.
Inside the grid there are select boxes to filter rows
On submit action, I use setPostDataItem to fix criteria with content of input fields and then trigger(“reloadGrid”). That's OK.
On loadComplete, the select boxes are filled with new values. That's ok
But if there was a filter selected before use submit, the select value is transmitted and I don't obtain the correct data.
If I try using clearSearch() before use setPostDataItem and trigger(“reloadGrid”),
finally I used the afterClear event.
All is fine now
Good evening
Happy new year,
unfortunately the precedent solution seem not work properly !
Have you an idea ?
Thanks
I think there is a simple solution for this. Just emty the div where you create the filterGrid and construct it again with a new one with the desired select values, after two reloads.
Regards
Stay connected with us in your favorite flavor!
Copyright 2014 TriRand LtdAll Rights ReservedRSS