原創|使用教程|編輯:龔雪|2021-03-15 11:03:32.537|閱讀 173 次
概述:Kendo UI是帶有jQuery、Angular、React和Vue庫的JavaScript UI組件的最終集合,本文將為大家介紹Kendo UI for jQuery如何更改PivotGrid字段名稱。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Kendo UI for jQuery R3 2020 SP2試用版下載
Kendo UI是帶有jQuery、Angular、React和Vue庫的JavaScript UI組件的最終集合,無論選擇哪種JavaScript框架,都可以快速構建高性能響應式Web應用程序。通過可自定義的UI組件,Kendo UI可以創建數據豐富的桌面、平板和移動Web應用程序。通過響應式的布局、強大的數據綁定、跨瀏覽器兼容性和即時使用的主題,Kendo UI將開發時間加快了50%。
可以修改和控制Kendo UI PivotGrid小部件的字段名稱所呈現的內容。
下面的示例演示如何更改PivotGrid中[Date].[Calendar]和[Product].[Category] 字段顯示的文本。
<div id="example"> <div id="configurator"></div> <div id="pivotgrid"></div> <script> $(document).ready(function () { var pivotgrid = $("#pivotgrid").kendoPivotGrid({ filterable: true, columnWidth: 200, height: 580, dataBound: function() { var fields = this.columnFields.add(this.rowFields).add(this.measureFields); fields.find(".k-button") .each(function(_, item) { item = $(item); var text = item.data("name").split(".").slice(-1) + ""; item.contents().eq(0).replaceWith(text); }); }, dataSource: { type: "xmla", columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ], rows: [{ name: "[Geography].[City]" }], measures: ["[Measures].[Internet Sales Amount]"], 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"); }); </script> <style> #pivotgrid { display: inline-block; vertical-align: top; width: 70%; } </style> </div>
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都網