AngularJS +Kendo UI Grid template

var dataSource = new kendo.data.DataSource({
transport: {
dataType: "json",
read: inputUri + $stateParams.subjectID,
},
pageSize: 10,
});

$scope.mainGridOptions = {
dataSource: dataSource,
//height: 420,
scrollable: false,
sortable: true,
filterable: true,
//pageable: {
// refresh: true,
// pageSizes: true,
// buttonCount: 5
//},
selectable: true,
columns: [
{
field: "Name",
title: "Input Name",
width: "300px"
},
{
field: "Value",
title: "Value",
template: '<input type="text" value="#= Value#" />'
},
{
field: "Page",
title: "Page",
template: '<input type="text" value="#= Page#" />'
}
],
dataBound: function () {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
noRecords: true
};


$scope.detailGridOptions = function (dataItem) {
return {
dataSource: {
transport: {
dataType: "json",
read: baseUri + $stateParams.documentID,
},
filter: { field: "InputID", operator: "eq", value: dataItem.ID }
},
scrollable: true,
sortable: true,
pageable: false,
columns: [
{ title: "ID", width: "50px", template: "<span class='row-number'></span>" },
{ field: "OptionValue", title: "Value", template: "#if(OptionValue == null) {#<textarea style='width:90%'></textarea>#} else{##:OptionValue##}#" },
{ field: "Page", title: "Page", width: "80px", template: "#if(Page == null) {#<input type='text' style='width:90%'/>#} else{##:Page##}#" },
{ template: '<input type="checkbox" #= IsAnswer ? \'checked="checked"\' : "" # class="chkbx" ng-click="checkboxClicked(dataItem)"/>', width: "80px" }
],
selectable: true,
dataBound: function () {
var rows = this.items();
$(rows).each(function () {
var index = $(this).index() + 1;
var rowLabel = $(this).find(".row-number");
$(rowLabel).html(index);
});
}
};
};

转载于:https://www.cnblogs.com/mabelhua/p/7493281.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值