Kendo UI for jQuery R1 2021 SP1試用版下載
Kendo UI是帶有jQuery、Angular、React和Vue庫的JavaScript UI組件的最終集合,無論選擇哪種JavaScript框架,都可以快速構建高性能響應式Web應用程序。通過可自定義的UI組件,Kendo UI可以創建數據豐富的桌面、平板和移動Web應用程序。通過響應式的佈局、強大的數據綁定、跨瀏覽器兼容性和即時使用的主題,Kendo UI將開發時間加快了50%。
通過PivotGrid,您可以控制尺寸標籤呈現的內容格式。
通過在行或標題模板中實現自定義模板,可以實現此操作。
下面的示例演示如何在PivotGrid中格式化維度標籤的日期值。
<script src="https://demos.telerik.com/kendo-ui/content/shared/js/products.js"></script> <div id="example"> <div id="pivotgrid"></div> <div class="responsive-message"></div> <script id="rowTemplate" type="text/x-kendo-template"> # if (member.name.indexOf("LastSupply") === 0 && member.name !== "LastSupply") { # #: kendo.toString(kendo.parseDate(member.caption), "d") # # } else { # #: member.caption # # } # </script> <script> $(document).ready(function () { var d = new Date(); products.forEach(function(p) { p.LastSupply = new Date(d); d.setDate(d.getDate() + 1); }); var pivotgrid = $("#pivotgrid").kendoPivotGrid({ columnWidth: 120, height: 570, rowHeaderTemplate: $("#rowTemplate").html(), dataSource: { data: products, schema: { model: { fields: { ProductName: { type: "string" }, UnitPrice: { type: "number" }, UnitsInStock: { type: "number" }, Discontinued: { type: "boolean" }, LastSupply: { type: "date" }, 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" } } } }, columns: [{ name: "CategoryName", expand: true }, { name: "ProductName" } ], rows: [{ name: "Discontinued", expand: true }, { name: "LastSupply", expand: false }], measures: ["Sum"] } }).data("kendoPivotGrid"); }); </script> </div>