This is a migrated thread and some comments may be shown as answers.

What is the View Model for a custom grid filter

1 Answer 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 02 Apr 2014, 11:57 AM
I am specifying a custom filter UI for a column where I am making some fairly significant changes. I've noticed that the default filter UI uses data-bind attributes that reference filters[0].value (for example). Is there a way to inspect/debug the view model?

One of my changes is to use a MultiSelect control, so I was wondering if it was possible to use data binding attributes to keep the selected values in sync with the grid's filters.

Also is there any way to modify the view model? for example if I wanted to add a property that indicated whether the filter operator was either 'eq' or 'neq' can I add this to the view model in some way?

 

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 04 Apr 2014, 08:34 AM
Hi Alex,

That viewModel is prepared just before displaying the filter menu and is not publicly exposed. Binding a MultiSelect widget to the dataSource's filter is currently not supported out of the box. Similar behavior could be implemented using a custom solution, which removes the bindings and manually merges the existing filters with the new ones. You can find a very basic example of how that could be achieved here.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or