Kendo UI for jQuery網(wǎng)格使用教程:數(shù)據(jù)綁定之本地?cái)?shù)據(jù)
Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個(gè)控件。Kendo UI for jQuery是創(chuàng)建現(xiàn)代Web應(yīng)用程序的最完整UI庫(kù)。
默認(rèn)情況下,Kendo UI Grid for jQuery自動(dòng)綁定數(shù)據(jù)。網(wǎng)格加載后,數(shù)據(jù)源立即發(fā)送查詢(xún),并將數(shù)據(jù)加載到窗口小部件。 要禁用此操作,請(qǐng)將小部件的autoBind選項(xiàng)設(shè)置為false,如下所示。
$("#grid").kendoGrid({ autoBind: false, // Other configuration. });
本地?cái)?shù)據(jù)
Kendo UI Grid使您可以將其綁定到本地?cái)?shù)據(jù)數(shù)組。要將Grid綁定到本地?cái)?shù)據(jù),請(qǐng)?jiān)O(shè)置kendoGrid對(duì)象的dataSource選項(xiàng)。
有關(guān)可運(yùn)行的示例,請(qǐng)參閱demo on binding the Grid to local data
var people = [ { firstName: "John",lastName: "Smith",email: "john.smith@telerik.com" },{ firstName: "Jane",lastName: "Smith",email: "jane.smith@telerik.com" },{ firstName: "Josh",lastName: "Davis",email: "josh.davis@telerik.com" },{ firstName: "Cindy",lastName: "Jones",email: "cindy.jones@telerik.com" } ]; $("#grid").kendoGrid({ dataSource: people });
如圖所示:綁定到本地?cái)?shù)據(jù)陣列的網(wǎng)格
了解最新Kendo UI最新資訊,請(qǐng)關(guān)注Telerik中文網(wǎng)!
掃描關(guān)注慧聚IT微信公眾號(hào),及時(shí)獲取最新動(dòng)態(tài)及最新資訊