溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Kendo UI for jQuery數(shù)據(jù)管理使用中如何將行標題字幕顯示為錨點

發(fā)布時間:2021-09-18 10:04:37 來源:億速云 閱讀:162 作者:柒染 欄目:編程語言

Kendo UI for jQuery數(shù)據(jù)管理使用中如何將行標題字幕顯示為錨點,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細講解,有這方面需求的人可以來學習下,希望你能有所收獲。

Kendo UI for jQuery R1 2021 SP2試用版下載

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)式的布局、強大的數(shù)據(jù)綁定、跨瀏覽器兼容性和即時使用的主題,Kendo UI將開發(fā)時間加快了50%。

PivotGrid允許您將標題呈現(xiàn)為錨點。

要將列標題和單元格標題字段呈現(xiàn)為錨點,請分別使用columnHeaderTemplate或dataCellTemplate選項。

要將行標題字段呈現(xiàn)為錨點,請使用rowHeaderTemplate選項,下面的示例演示如何實現(xiàn)此操作。

<script src="https://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 href="https://www.telerik.com">#: 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>

看完上述內(nèi)容是否對您有幫助呢?如果還想對相關(guān)知識有進一步的了解或閱讀更多相關(guān)文章,請關(guān)注億速云行業(yè)資訊頻道,感謝您對億速云的支持。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI