admin管理员组

文章数量:1440487

I need to disable the Kendo filter option on particular column on click of a button. I gave a shot as mentioned in link Grid Custom Filter for Columns Not In Grid but it throws error since filterable is not defined. Please help.

function ButtonClick() {
var TestGridDetails = $("#TestGrid").data("kendoGrid");
TestGridDetails.columns[6].filterable(false);
}

I need to disable the Kendo filter option on particular column on click of a button. I gave a shot as mentioned in link Grid Custom Filter for Columns Not In Grid but it throws error since filterable is not defined. Please help.

function ButtonClick() {
var TestGridDetails = $("#TestGrid").data("kendoGrid");
TestGridDetails.columns[6].filterable(false);
}
Share Improve this question edited May 23, 2017 at 12:08 CommunityBot 11 silver badge asked Nov 28, 2014 at 9:09 InterstellarInterstellar 6742 gold badges13 silver badges30 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

It seems you can't just change one column value; you can change options globally with the setOptions method but you need to define all of the columns' details.

function ButtonClick() {
  var TestGridDetails = $("#TestGrid").data("kendoGrid"),
      columnsConfig = TestGridDetails.options.columns;
  columnsConfig[6].filterable = false;
  TestGridDetails.setOptions({columns: columnsConfig});
}

本文标签: javascriptDisable kendogrid filter on particular columnStack Overflow