How to change columns set of kendo grid dynamically

前端 未结 11 592
孤城傲影
孤城傲影 2020-12-04 19:08

I am trying to change the columns collection of my Kendo grid in the below way.

var grid = $(\"#grid\").data(\"kendoGrid\");
$http.get(\'/api/GetGridColumns\         


        
11条回答
  •  我在风中等你
    2020-12-04 19:36

    Here is what i use

    var columns = [];//add the columns here
    var grid = $('#grid').data('kendoGrid');
            grid.setOptions({ columns: columns });
            grid._columns(columns);
            grid._templates();
            grid.thead.empty();
            grid._thead();
            grid._renderContent(grid.dataSource.view());
    

提交回复
热议问题