Kendo UI for jQuery数据管理使用教程:重新加载 PivotGrid 配置选项

以下示例演示如何在按钮单击事件上重新加载 Kendo UI PivotGrid 小部件的配置选项。 为了设置选项,演示使用PivotDataSource API。

<div id="example"><button id="reload">Reload PivotDataSource configuration</button><div id="pivotgrid"></div><div class="responsive-message"></div><script>$(document).ready(function () {var options = {columns: [{"name":["[Date].[Calendar]"],"expand":true},{"name":["[Product].[Category]"]}],rows: [{"name":["[Geography].[City]"]}],measures: [{"name":"[Measures].[Reseller Freight Cost]"}],filter: {"logic":"and","filters":[{"field":"[Date].[Calendar]","operator":"in","value":"[Date].[Calendar].[Calendar Year].&[2006],[Date].[Calendar].[Calendar Year].&[2008]"}]}};var dataSourceConfig = {type: "xmla",transport: {connection: {catalog: "Adventure Works DW 2008R2",cube: "Adventure Works"},read: "https://demos.telerik.com/olap/msmdpump.dll"},schema: {type: "xmla"},error: function (e) {alert("error: " + kendo.stringify(e.errors[0]));}};var pivotgrid = $("#pivotgrid").kendoPivotGrid({filterable: true,sortable: true,columnWidth: 200,height: 580,dataSource: dataSourceConfig}).data("kendoPivotGrid");$("#reload").click(function() {var newOptions = $.extend({}, dataSourceConfig, options);var newSource = new kendo.data.PivotDataSource(newOptions);pivotgrid.setDataSource(newSource);});});</script></div>

高端UI界面开发
标签:

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年5月26日
下一篇 2021年5月26日

相关推荐

发表回复

登录后才能评论