jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Feature request: Grid filter with list for server-side filtering
This topic contains 3 replies, has 3 voices, and was last updated by Peter Stoev 10 years, 8 months ago.
-
Author
-
Hi there,
I have a feature request and want to share it, maybe someone else also needs such a feature or has a good solution:
The grid widget allows several filters, one of them is the filtertype “list”. In a well documented example server-sided filtering is explained. The problem is, that if you want to display data with a 1-n relation, filtering the relation is not possible correctly.
Example:
Imagine a grid displaying employees with name, email, birthdate and so on. Additionally the employees are assigned to a company with a 1-n relation in the database. There the employee has a foreign key to the company table. Displaying the company name as a column is easy and clear. Building a list filter with all companies is also possible, but on filtering only the label is submitted as a GET parameter in the ajax request.It would be a nice feature to pass the value, not the display member as the filter. This would allow performant SQL on server-side following the 1-n relation, as the ID of the company could be passed.
Working with a callback-function is not a good solution as far as I understood it. There you can match the label against the filter choice and replace it by the ID. But this approach fails when you have two companies with different IDs but the same name. In such a scenario it would lead to false data.Greetings,
NikolaHi Nikola,
That is something which is custom to your scenario and as it is explained in this help topic – http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm, you can pass to the server whatever variables you need and want to pass. In addition, the Grid has “getfilterinformation” method which returns the applied filter(s) information and you can also modify the filtering variable which the grid originally passes.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/September 19, 2014 at 10:40 am Feature request: Grid filter with list for server-side filtering #59773Hi Peter,
Can you provide me an example please How to Modify Filter Parameters before sending it to server side.September 19, 2014 at 3:00 pm Feature request: Grid filter with list for server-side filtering #59787Hi mrkhanakia,
This help topic: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-extra-http-variables.htm illustrates how to modify or add additional parameters on each server request.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.