Filtering support on datatable kendo ui

25 views
Skip to first unread message

Vasilis Dev

unread,
Nov 26, 2020, 5:47:38 PM11/26/20
to wicket-jquery-ui
Hi Sebastian,

I am currently develop an application that uses datatable of kendo-ui and I want to add filtering as a feature. I have seen the internals of DatatableProviderBehavior and as I understood I need to implement the IFilterStateLocator.Is this the way to integrate filtering operations that kendo-ui supports or I need a custom implementation ?

Thank you in advance.

Sebastien Briquet

unread,
Nov 29, 2020, 7:43:56 AM11/29/20
to wicket-jquery-ui
Hi Vasilis,

Yes you are right, there is several things to do:

Your DataProvider should implement IFilterStateLocator, and should provide a filterState object and initialize it to an empty state (or use setFilterState). This object will be returned by getFilterState.

The DataTable will then fill the properties of the pojo (ie: filterState) according to the value entered as for the filter. That is only what the DataTable does.
Unfortunately the implementation of the filtering is far from begin complete, we do not retrieve the logic nor the operators (there is a TODO in the code, I never had time to work-on/finish this part).

The filtering of values remains to you, use the stateFilter object to build your SQL query or whatever...

Finally your DataTable should set the "filterable" option. Either to true or to "{ mode: 'row'}". Look at Kendo UI Grid API for more details.
You can also enable/disable/set-up the filtering per columns. See getFilterable() in IColumn

Hope this helps,
Sebastien.

Reply all
Reply to author
Forward
0 new messages