Kendo UI是帶有jQuery、Angular、React和Vue庫的JavaScript UI組件的最終集合,無論選擇哪種JavaScript框架,都可以快速構(gòu)建高性能響應(yīng)式Web應(yīng)用程序。通過可自定義的UI組件,Kendo UI可以創(chuàng)建數(shù)據(jù)豐富的桌面、平板和移動(dòng)Web應(yīng)用程序。通過響應(yīng)式的布局、強(qiáng)大的數(shù)據(jù)綁定、跨瀏覽器兼容性和即時(shí)使用的主題,Kendo UI將開發(fā)時(shí)間加快了50%。


以下示例演示了當(dāng)用戶將鼠標(biāo)懸停在Kendo UI PivotGrid小部件中的數(shù)據(jù)單元格元素時(shí)如何顯示工具提示。
$(document).ready(function () {
$("#pivotgrid").kendoPivotGrid({
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: "AllProducts" },
CategoryName: { caption: "AllCategories" },
Discontinued: { caption: "AllDiscontinued" }
},
measures: {
"Sum": { field:"UnitPrice", format: "{0:c}", aggregate: "sum" }
}
}
},
rows: [{ name: "CategoryName",expand: true }, { name: "ProductName" } ],
columns: [{ name: "Discontinued",expand: true }],
measures: ["Sum"]
}
});
?
$(".k-grid-content").kendoTooltip({
filter: "td",
content: toolTip,
width: 400,
height: 100,
position: "top"
});
?
$(".k-grid-content").click(toolTip);
?
function toolTip(e) {
var target = $(e.target);
var grid =$("#pivotgrid").getKendoPivotGrid();
?
var cellInfo =grid.cellInfoByElement(target);
?
return kendo.template($("#template").html())({
rowText: generateName(cellInfo.rowTuple),
columnText:generateName(cellInfo.columnTuple),
value: cellInfo.dataItem.fmtValue
});
}
?
function generateName(tuple) {
var text = "";
var members = tuple.members;
?
for (var idx = 0, length = members.length;idx < length; idx++) {
text += members[idx].name;
?
if (members[idx + 1]) {
text += "->";
}
}
?
return text;
}
});
京ICP備09015132號(hào)-996 | 違法和不良信息舉報(bào)電話:4006561155
© Copyright 2000-2026 北京哲想軟件有限公司版權(quán)所有 | 地址:北京市海淀區(qū)西三環(huán)北路50號(hào)豪柏大廈C2座11層1105室
北京哲想軟件集團(tuán)旗下網(wǎng)站:哲想軟件 | 哲想動(dòng)畫