Problem with jqgrid multiselect filter with grid update

I checked demo to implement Multiselect filtering in my project.

This is a good demonstration, but there are some problems with it. Select a filter and click the refresh button, then the filters will not be reset. And after that, it will start to work incorrectly.

Choose a filter:

Select a filter

After updating the update:

Filters are not reset After hitting refresh

Now uncheck the filter:

enter image description here Got an empty grid. Now unchecked the filter

How can I fix these problems? Any ideas.

+3
jqgrid jquery-multiselect
Nov 15 '14 at 10:18
source share
1 answer

Thanks for reporting the error! There is an error in the clearToolbar in the lines of code. I will report an error later in trirand.

To fix the problem, you need to use the beforeClear filterToolbar beforeClear :

 beforeClear: function () { $(this.grid.hDiv) .find(".ui-search-toolbar .ui-search-input>select[multiple] option") .each(function () { // unselect all options in <select> this.selected = false; } ); $(this.grid.hDiv) .find(".ui-search-toolbar button.ui-multiselect") .each(function () { // synchronize jQuery UI Multiselect with <select> $(this).prev("select[multiple]").multiselect("refresh"); } ).css({ width: "98%", marginTop: "1px", marginBottom: "1px", paddingTop: "3px" }); } 

The demo demonstrates a workaround. If the error in jqGrid is resolved, you can remove the first tree rows from the beforeClear , as in the demo .

+5
Nov 15 '14 at 19:36
source share



All Articles