KendoUI Grid Ajax Binding Parameters For Select

后端 未结 3 2077
梦如初夏
梦如初夏 2021-02-08 11:57

I have a basic KendoUI Grid for my ASP.NET MVC app which uses ajax binding for the read. I\'d like to enhance this so that a Form above the grid is used to help se

3条回答
  •  故里飘歌
    2021-02-08 12:34

    You can set the filters on the grid by calling filter on the grid's data source.

    So in your button's onclick handler function, put something like this:

    var $Grid = $('#Grid').data('kendoGrid');
    
    $Grid.dataSource.filter([
      { field: 'FirstName', operator: 'eq', value: $('#firstName').val() },
      { field: 'LastName', operator: 'eq', value: $('#lastName').val() }
    ]);
    

    Here's a link to the Kendo docs: DataSource.filter

提交回复
热议问题