Home › Forums › Guriddo Suito PHP › Filter Toolbar Multi-Pick
Tagged: filters
Hi all,
I’m hoping someone can help, I have two issues (hopefully small) that I’m having trouble with.
Any ideas?
Many thanks in advance.
I am also interested in the same,
I would also like to be able to filter on a value range e.g. age between 20 and 30
MymsMan
Hello,
We prepare a article with demo. It will be available tomorrow.
Kind Regards
Will
Guriddo Support Team
Many thanks.
Hello,
It was not so easy as we suggest initially. We have some technical issues.
For now we have prepared a pre build demo of this feature. This is not official and contain code not published in the web.
The demo uses a jquery ui multiselect plugin.
The demo can be seen here .
Please let us know if you have recommendations and new ideas.
We will try to extend toolbar search with more controls and features for the next release including range.
Kind Regards,
Will
P.S. We hope to finish this to the end of week.
Guriddo Support Team
Hello,
About the second question.
Basically you ca get the filter using the javaScript method getGridParam.
This is a string anf you can seve it wher you want – database, cookie, or localStorage.
To load the grid upon loading with the filter you may need to consider this demo:
Kind Regards,
Will
Guriddo Support Team
That looks like exactly what I need, the “all” looks a bit buggy but as you mention it’s work in progress.
Am I right to think that getGridParam will support the multi-select option when it’s done?
Thanks again for this effort.
Hello,
Please look at the updated demo here
To use this feature you will need to complete the following steps.
Please let us know if you have difficulties with this.
Again with this we have implemented a range operator in toolbar searching, but it will be available in the next release.
Kind Regards
Guriddo Support Team
Many thanks for this, I’m using Guriddo jqGrid PHP can you detail which files need to be replaced in here as there are more files in the jqGrid distribution compared to mine.
Or is replacing the jquery.jqGrid.min.js enough.
Again many thanks.
Hello,
jquery.jqGrid.min.js or jquery.jqGrid.js is fine.
Please, let us know about the result.
Thank you.
Kind Regards,
Will
Guriddo Support Team
Had a play around, this is looking great, many thanks.
Is it possible to save and load the filters?
I’ve tried:
|
1 2 |
jQuery('#grid').jqGrid('getGridParam','colModel'); jQuery.post("alertprocessor_ajax.php?id=savelayout", { data: JSON.stringify(schema) }) |
with:
|
1 2 3 |
var obj = JSON.parse(data); jQuery('#grid').jqGrid('setGridParam',{colModel: obj}).trigger("reloadGrid"); |
and also
var schema = jQuery('#grid').jqGrid('getGridParam','postData');
with
|
1 2 3 |
var obj = JSON.parse(data); jQuery('#grid').jqGrid('setGridParam',{postData: obj}).trigger("reloadGrid"); |
But I cannot seem to get the layout to hold for the multi-select, is the data somewhere I can access so I can save the layout and reload it later?
In the background I stringify the data and store it in the database then reload using jQuery after sending through JSON.parse.
Many thanks.
Hello,
Should we think that the grid is already constructed and on a existing grid you load the the stored filters and try to apply them?
Also I suppose that a toolbar searching is used.
Kind Regards,
Will
Guriddo Support Team
Correct, the grid is constructed, I set the filters, sort etc and hit save, this runs a jQuery to store the sorting/filtering/column widths etc.
Then the grid is fully loaded, the user presses “Load” and the grid is loaded with there setup.
However if there is an easier way to achieve the same thing by going a full page refresh that works for me.
Correct the toolbar is on, below is what is looks like (sorry I had to hide the data), I’m hoping in the action column to have a button or link to do some custom actions (I’m working on that part)

Many thanks.
Hello,
The multiselect is a external plugin and you should upfdate it manually.
Loading the filtered data and trigerring the grid does not refresh the data on filter toolbar.
Especially for your case we have created the new method called refreshFilterToolbar.
To this method you can pass the filters as string or as object.
You can call it after the loading the and triggering the grid.
Note that you should manually refersh the multiselect plugin after this operation.
Download the the last build from github and replace the jqquery.jqGrid.js file.
the code can look like this
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
var obj = JSON.parse(data); jQuery('#grid').jqGrid('setGridParam',{postData: obj}).trigger("reloadGrid"); jQuery('#grid').jqGrid('refreshFilterToolbar', {filters: obj.filters}); // finally refresh the multiselect plugin var elem = $("#gs_CustomerID"); // this is the element elem.multiselect('refresh'); elem.siblings('button.ui-multiselect').css({ width: "100%", marginTop: "1px", marginBottom: "1px", paddingTop: "3px" }) |
Hope this helps
Kind Regards
Will
Guriddo Support Team
Many thanks, this works well.
I did find it a pain naming all the multi selects manually so, modified the jQuery code slightly.
|
1 2 3 4 5 6 7 8 9 10 11 |
var items = jQuery("[aria-multiselectable=true]"); jQuery.each(items,function () { var obj = jQuery('#' + this.id); obj.multiselect('refresh'); obj.siblings('button.ui-multiselect').css({ width: "100%", marginTop: "1px", marginBottom: "1px", paddingTop: "3px" }); }); |
I’m sure the initial jQuery select can be tidied a bit so it returns an object not a string, but I struggled to get an object back.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top