Kendo透视网格中的CellTemplate或rowTemplate

时间:2018-10-09 10:58:20

标签: kendo-grid pivot-grid

我正在使用简单的Angularjs在Kendo Pivot网格上工作。我实现的结果是使用成功绑定到网格的Jsonp数据。

现在,我想在枢轴网格内的某些单元格上单击后调用另一个网格。

enter image description here

使用的代码

$scope.dataSource = new kendo.data.PivotDataSource({
                    data: $scope.datas.data,
                    schema: {
                        model: {
                            //initializing the fields used and specifying their datatypes
                            fields: {
                                "Relationship": { type: "string" ,cellTemplate:"<a href=''></a>"},
                                "Entity": { type: "string" },
                                "TenantGLAccountDescription": { type: "string" },
                                "JournalEntryDescription": { type: "string" },
                                "AccountName": { type: "string" },
                                "AcccountNumber": { type: "number" },
                                "ChartofAccounts": { type: "string" },
                                "TenantGLAccountNumber": { type: "string" },
                                "TenantGLAccountDescription": { type: "string" },
                                "Category": { type: "string" },
                                "Subcategory": { type: "string" },
                                "AccountType": { type: "string" },
                                "AccountSubType": { type: "string" },
                            }
                        },
                        //specifying all the parent column names
                        cube: {
                            dimensions: {
                                "Relationship": { caption: "Relationships" },
                                "Entity": { caption: "All Entities" },
                                "JournalEntryDescription": { caption: "JournalEntryDescription" },
                                "AccountName": { caption: "AccountName" },
                                "AcccountNumber": { caption: "AcccountNumber" },
                                "ChartofAccounts": { caption: "ChartofAccounts" },
                                "TenantGLAccountNumber": { caption: "TenantGLAccountNumber" },
                                "TenantGLAccountDescription": { caption: "TenantGLAccountDescription" },
                                "Category": { caption: "Categories" },
                                "Subcategory": { caption: "SubCategory" },
                                "AccountType": { caption: "AccountType" },
                                "AccountSubType": { caption: "AccountSubType" },
                            },
                            measures: {
                                "Amount": { field: "Amount", format: "{0:c}", aggregate: "sum", footerTemplate: "Total Assets: #=sum#", groupFooterTemplate: "Count: #=sum#" },

                            }
                        },
                    },
                    error: function (e) {
                        alert("error: " + kendo.stringify(e.errors[0]));
                    },
                    columns: [{ name: "Relationship" , expand: true,cellTemplate:"<a href=''>Hello</a>" },{name: "Category"}],
                    //columns: datas.data,
                    rows: [ { name: "Subcategory" , expand: true}],
                    measures: ["Amount"]
                });

               $scope.options = {
                    columnWidth: 200,
                    height: 580,
                    scrollable: true,
                    pageable: true,
                    sortable: true,
                    groupable: true,
                    filterable: true,
                    selectable: true}

有没有办法在单击一个单元格时使用弹出窗口,该单元格使用cellTemplate或rowTemplate给我另一个网格,并调用一个函数,该函数将发送一些数据作为参数来加载网格? / p>

0 个答案:

没有答案