如何在不使用 jquery 的情况下隐藏和显示剑道网格的列?这是示例的 js fiddle 链接:http: //jsfiddle.net/tmLmk/7/
HTML 代码:
<div ng-controller="GridController">
<div kendo-grid k-options="options" k-data-source="sData"></div>
</div>
JS代码:
angular.module('angular-kendo-example', ['kendo.directives']);
function GridController($scope) {
$scope.options = {
sortable: true,
pageable: true,
columns: [{
field: "column1",
title: "column 1",
width: "40px"
},{
field: "column2",
title: "column 2",
width: "70px"
},{
field: "column3",
title: "column 3",
width: "70px"
},{
field: "column4",
title: "column 4",
width: "60px"
},{
field: "column5",
title: "column 5",
width: "40px"
},{
field: "column6",
title: "column 6",
width: "40px"
}],
};
$scope.sData= [
{ column1: "column1 data", column2: "column2 data", column3: "column3 data", column4: "column4 data", column5: "column5 data", column6: "column6 data" }, { column1: "column1 data", column2: "column2 data", column3: "column3 data", column4: "column4 data", column5: "column5 data", column6: "column6 data" }, { column1: "column1 data", column2: "column2 data", column3: "column3 data", column4: "column4 data", column5: "column5 data", column6: "column6 data" }
];
}
谢谢。