原創(chuàng)|使用教程|編輯:龔雪|2021-06-17 10:22:06.633|閱讀 309 次
概述:本文演示如何使用包含字段項訪問 TreeView 并在打開 Kendo UI PivotGrid 小部件中的窗口時擴(kuò)展根節(jié)點。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
Kendo UI for jQuery R2 2021試用版下載
Kendo UI是帶有jQuery、Angular、React和Vue庫的JavaScript UI組件的最終集合,無論選擇哪種JavaScript框架,都可以快速構(gòu)建高性能響應(yīng)式Web應(yīng)用程序。通過可自定義的UI組件,Kendo UI可以創(chuàng)建數(shù)據(jù)豐富的桌面、平板和移動Web應(yīng)用程序。通過響應(yīng)式的布局、強(qiáng)大的數(shù)據(jù)綁定、跨瀏覽器兼容性和即時使用的主題,Kendo UI將開發(fā)時間加快了50%。
下面的示例演示如何使用包含字段項訪問 TreeView 并在打開 Kendo UI PivotGrid 小部件中的窗口時擴(kuò)展根節(jié)點。
<div id="example"> <div id="configurator"></div> <div id="pivotgrid"></div> <script> $(document).ready(function () { var pivotgrid = $("#pivotgrid").kendoPivotGrid({ filterable: true, sortable: true, columnWidth: 200, height: 580, dataSource: { type: "xmla", columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ], rows: [{ name: "[Geography].[City]" }], measures: ["[Measures].[Reseller Freight Cost]"], transport: { connection: { catalog: "Adventure Works DW 2008R2", cube: "Adventure Works" }, read: "http://demos.telerik.com/olap/msmdpump.dll" }, schema: { type: "xmla" }, error: function (e) { alert("error: " + kendo.stringify(e.errors[0])); } } }).data("kendoPivotGrid"); $("#configurator").kendoPivotConfigurator({ dataSource: pivotgrid.dataSource, filterable: true, sortable: true, height: 580 }); //wire 'Include fields' open $("[data-role=pivotsettingtarget]").each(function(_, setting) { var fieldMenu = $(setting).data("kendoPivotSettingTarget").fieldMenu; //get setting FieldMenu if (fieldMenu) { fieldMenu.includeWindow.bind("open", function() { //wire open event of the 'Include Fields' window var treeView = fieldMenu.treeView; if (treeView) { treeView.one("dataBound", function() { treeView.expand(".k-item:first"); //Expand the root node }); } }); } }); }); </script> </div>
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都網(wǎng)