filter grid via javascript

2 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 14 May 2014 Link to this post

    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");{ "page": 1, "pageSize": 10, "filter": "Paid~eq~false" })
  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2213 posts

    Posted 14 May 2014 Link to this post

    Hi Alan,

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

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

    I hope this information helps.

    Dimiter Madjarov

    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.

Back to Top