我有一个kendo网格,我想在kendo网格的同一列中添加一个链接和一个按钮。当我将按钮添加到网格列中时,模板中的链接将从列中消失。
我的网格配置:
subCategoryGrid: {
sortable: true,
height: 600,
pageable: {
previousNext: false,
pageSizes: false
},
toolbar: [{
template: kendo.template('<kendo-tabstrip><ul class="header-backGround"><li ng-class="{\'k-state-hover k-state-active\': defaultAllTab}"><a class="k-grid-add border" ng-click="getAllSubCategories()">All</a></li>')
}, {
template: kendo.template('<li ng-class="{\'k-state-hover k-state-active\': defaultPendingTab}"><a class="k-grid-add border" ng-click="getPendingSubCategories()">Pending Review</a></li>')
}, {
template: kendo.template('<li ng-class="{\'k-state-hover k-state-active\': defaultReviewTab}"><a class="k-grid-add border" ng-click="getReviewedSubCategories()">Reviewed</a></li></ul><kendo-tabstrip>')
}],
filterable: true,
columns: [{
template: '<strong><span ng-if="this.dataItem.sortCode === 1" class="text-success">NEW</span><span ng-if="this.dataItem.sortCode === 2" class="text-danger">!</span></strong>',
width: '30px'
}, {
template: kendo.template('<a ngMouseup="font-linksColor ng-class="\'k-state-hover k-state-active\'"" ng-click=\'fetchSubCategoryDetails(this.dataItem)\'>{{this.dataItem.subCategoryName}}</a>'),
field: 'subCategoryName',
title: 'Subcategory',
width: '100px',
command: [
{
text: 'Details',
template: '<button class=\'k-button k-button-icontext\' ng-click=\'showDetail(this.dataItem)\'>Detail</button>',
title: 'Action',
width: '25px'
},
],
}, {
field: 'status',
title: 'Status',
width: '65px'
}]
},
答案 0 :(得分:0)
您不能同时对列使用模板和命令选项;如果你使用模板,你需要在那里创建你的按钮,即:
template: kendo.template('<a> ...</a><button>...</button>'),