分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 前端开发

AngularJS +Kendo UI Grid template

发布时间:2023-09-06 01:09责任编辑:胡小海关键词:AngularAngularJS

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);
???????????????});
???????????}
???????};
???};

AngularJS +Kendo UI Grid template

原文地址:http://www.cnblogs.com/mabelhua/p/7493281.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved