asp.net mvc - Why is this initial Kendo grid filter not working? -
i have model so:
id type ------------- 1 vehicle 2 trailer 3 vehicle
i hoping utilize radio button command how info filtered on kendo grid, choosing filter on whether type
equals vehicle
or trailer
. don't know how that, but, now, can't initial filter work. grid follows:
@(html.kendo().grid<pckendoui.models.companyduedatesindexvm>() .name("duedates") .columns(columns => { columns.bound(c => c.id); columns.bound(c => c.type); }) .filterable() .datasource(ds => ds .ajax() .model(m => m.id(x => x.id)) .read(s => s.action("test", "companyduedates")) .filter(filter => { filter.add(f => f.type == "vehicle"); }) ) )
my code based on filter illustration documentation.
this still displays 3 records in model, rather rows 1
, 3
. interesting after specifying initial filter, filter controls not allow filter. is, visible, can type in info , click filter
, not filter grid.
does have thought problem be?
according documentation syntax not correct, wrote:
filter.add(f => f.type == "vehicle");
when should be:
filter.add(f => f.type).isequalto("vehicle");
asp.net-mvc filter kendo-ui telerik kendo-grid
No comments:
Post a Comment