原創(chuàng)|使用教程|編輯:龔雪|2021-04-02 10:19:59.540|閱讀 374 次
概述:本文主要介紹通過(guò)Kendo UI的PivotGrid控件,您可以在Kendo UI PivotGrid小部件的標(biāo)題中將行標(biāo)題字幕顯示為錨點(diǎn)。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
Kendo UI for jQuery R1 2021 SP2試用版下載
Kendo UI是帶有jQuery、Angular、React和Vue庫(kù)的JavaScript UI組件的最終集合,無(wú)論選擇哪種JavaScript框架,都可以快速構(gòu)建高性能響應(yīng)式Web應(yīng)用程序。通過(guò)可自定義的UI組件,Kendo UI可以創(chuàng)建數(shù)據(jù)豐富的桌面、平板和移動(dòng)Web應(yīng)用程序。通過(guò)響應(yīng)式的布局、強(qiáng)大的數(shù)據(jù)綁定、跨瀏覽器兼容性和即時(shí)使用的主題,Kendo UI將開發(fā)時(shí)間加快了50%。
PivotGrid允許您將標(biāo)題呈現(xiàn)為錨點(diǎn)。
要將列標(biāo)題和單元格標(biāo)題字段呈現(xiàn)為錨點(diǎn),請(qǐng)分別使用columnHeaderTemplate或dataCellTemplate選項(xiàng)。
要將行標(biāo)題字段呈現(xiàn)為錨點(diǎn),請(qǐng)使用rowHeaderTemplate選項(xiàng),下面的示例演示如何實(shí)現(xiàn)此操作。
<script src="http://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script> <div id="example"> <div id="pivotgrid"></div> <script id="headerTemplate" type="text/x-kendo-tmpl"> # if (!member.children.length && member.parentName === "ProductName") { # <a >#: member.caption #</a> # } else { # #: member.caption # # } # </script> <script> $(document).ready(function () { var pivotgrid = $("#pivotgrid").kendoPivotGrid({ rowHeaderTemplate: $("#headerTemplate").html(), columnWidth: 120, height: 570, dataSource: { data: products, schema: { model: { fields: { ProductName: { type: "string" }, UnitPrice: { type: "number" }, UnitsInStock: { type: "number" }, Discontinued: { type: "boolean" }, CategoryName: { field: "Category.CategoryName" } } }, cube: { dimensions: { ProductName: { caption: "All Products" }, CategoryName: { caption: "All Categories" }, Discontinued: { caption: "Discontinued" } }, measures: { "Sum": { field: "UnitPrice", format: "{0:c}", aggregate: "sum" }, "Average": { field: "UnitPrice", format: "{0:c}", aggregate: "average" } } } }, rows: [{ name: "CategoryName", expand: true }, { name: "ProductName" } ], columns: [{ name: "Discontinued", expand: true }], measures: ["Sum"] } }).data("kendoPivotGrid"); $("#configurator").kendoPivotConfigurator({ dataSource: pivotgrid.dataSource, height: 570 }); }); </script> </div>
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都網(wǎng)