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

filter grid via javascript

1 Answer 1706 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 14 May 2014, 02:41 PM
I want to filter a grid via JavaScript, but cant seem to work out how to pass data,
I have tried like this, Can this be done, thanks
var grid = $("#StudentInvoices").data("kendoGrid");
grid.dataSource.read({ "page": 1, "pageSize": 10, "filter": "Paid~eq~false" })

1 Answer, 1 is accepted

Sort by
2
Dimiter Madjarov
Telerik team
answered on 14 May 2014, 02:54 PM
Hi Alan,


If only the filtering should be performed, you could directly use the filter method of the dataSource.
E.g.
var grid = $("#StudentInvoices").data("kendoGrid");
grid.dataSource.filter( { field: "name", operator: "startswith", value: "Jane" });

The query method is suitable for more specific requests.
E.g.
grid.dataSource.query({
  page: 2,
  pageSize: 5,
  filter: { field: "Freight", operator: "gte", value: 24 }
})

I hope this information helps.

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or