0
votes

I would like to be able to filter kendo grid column which has dropdown data using following code

filter: [{
        "field": "id_person",
        "operator": "eq",
        "value": 4
   }]

In grid, field id_person is dropdown and has value something like this

id_person : {VALUE: "4", DESCRIPTION: "Keval"}

But filter is not working for that particular column because it has dropdown inside grid. How to achieve this ? please help.

Demo link: https://dojo.telerik.com/uvawonIh

1
The demo link is not as per your problem statement. Can you please share the sample code as per your problem statement ?Rohìt Jíndal

1 Answers

0
votes

The id field in your Dojo is not id_person, so filtering will not work when the filter criteria parameters specify "field":"id_person".

I am presuming you want to apply a filter to the grid data source from outside the grid itself, such as when a non-grid button is clicked.

Suppose your html has

<button id="filter" type="button">Filter</button>

then your jQuery ready function might have this statement within

  $("#filter").kendoButton({
    click: function(e) {

      var filterParameters =
        [{
          "field": "id",
          "operator": "eq",
          "value": 2
        }]
      ;

      $("#grid")
      .data("kendoGrid")
      .dataSource
      .filter(filterParameters)
      ;
    }
  });

See modified Dojo and DataSource filter method docs