原創(chuàng)|使用教程|編輯:龔雪|2020-04-17 09:32:04.710|閱讀 427 次
概述:Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個控件,Kendo UI for jQuery是創(chuàng)建現(xiàn)代Web應(yīng)用程序的最完整UI庫。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
Kendo UI for jQuery R1 2020 SP2試用版下載
Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個控件。Kendo UI for jQuery是創(chuàng)建現(xiàn)代Web應(yīng)用程序的最完整UI庫。
網(wǎng)格列的大小調(diào)整操作取決于是否啟用滾動,有關(guān)可運行的示例,請參閱有關(guān)調(diào)整Grid中列大小的演示。
<!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" href="styles/kendo.common.min.css" /> <link rel="stylesheet" href="styles/kendo.default.min.css" /> <link rel="stylesheet" href="styles/kendo.default.mobile.min.css" /> <script src="js/jquery.min.js"></script> <script src="js/kendo.all.min.js"></script> </head> <body> <div id="example"> <div id="grid"></div> <script> $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { type: "odata", transport: { read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders" }, schema: { model: { fields: { OrderID: { type: "number" }, ShipCountry: { type: "string" }, ShipCity: { type: "string" }, ShipName: { type: "string" }, OrderDate: { type: "date" }, ShippedDate: { type: "date" } } } }, pageSize: 15 }, height: 550, sortable: true, resizable: true, pageable: true, columns: [ { field: "OrderDate", title: "Order Date", width: 120, format: "{0:MM/dd/yyyy}" }, { field: "ShipCountry", title: "Ship Country", minResizableWidth: 100 }, { field: "ShipCity", title: "Ship City" }, { field: "ShipName", title: "Ship Name" }, { field: "ShippedDate", title: "Shipped Date", format: "{0:MM/dd/yyyy}", width: 200 }, { field: "OrderID", title: "ID", width: 80 } ] }); }); </script> </div> </body> </html>
禁用滾動并調(diào)整Grid列的大小時,其他列也會更改寬度,以便所有列寬度的總和保持恒定。 如果列和Grid <div>均已應(yīng)用了其最小可能寬度,則列的大小調(diào)整將停止工作。 在這種情況下,請在以下兩種方法中選擇一種使用:
啟用滾動并調(diào)整列的大小時,所有其他列均保持其寬度。 當(dāng)應(yīng)用列大小調(diào)整時,關(guān)于所有列寬度的總和,可能會產(chǎn)生以下結(jié)果:
根據(jù)設(shè)計,網(wǎng)格的最后一列沒有右邊框,因此如果網(wǎng)格表的寬度與網(wǎng)格小部件的寬度匹配,則網(wǎng)格的右端將不會出現(xiàn)雙邊框。如果需要,您可以在以下示例中為CSS代碼應(yīng)用右邊框, #ccc邊框的顏色值必須與Kendo UI主題中單元格邊框的顏色匹配,為此請使用DOM檢查器檢查表單元格的樣式。
.k-grid-header-wrap > table, .k-grid-content > table { border-right: 1px solid #ccc; }
Grid提供用于重新排序其列的選項。若要使用戶能夠通過拖動來重新排序網(wǎng)格的列,請將reorderable屬性設(shè)置為true。 有關(guān)可運行的示例,請參閱有關(guān)在Grid中實現(xiàn)列重新排序的演示。
<!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" href="styles/kendo.common.min.css" /> <link rel="stylesheet" href="styles/kendo.default.min.css" /> <link rel="stylesheet" href="styles/kendo.default.mobile.min.css" /> <script src="js/jquery.min.js"></script> <script src="js/kendo.all.min.js"></script> </head> <body> <div id="example"> <div id="grid"></div> <script> $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { type: "odata", transport: { read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders" }, schema: { model: { fields: { OrderID: { type: "number" }, ShipCountry: { type: "string" }, ShipCity: { type: "string" }, ShipName: { type: "string" }, OrderDate: { type: "date" }, ShippedDate: {type: "date" } } } }, pageSize: 15 }, height: 550, sortable: true, reorderable: true, resizable: true, pageable: true, columns: [ { field: "OrderDate", title: "Order Date", width: 120, format: "{0:MM/dd/yyyy}" }, { field: "ShipCountry", title: "Ship Country" }, { field: "ShipCity", title: "Ship City" }, { field: "ShipName", title: "Ship Name" }, { field: "ShippedDate", title: "Shipped Date", format: "{0:MM/dd/yyyy}", width: 200 }, { field: "OrderID", title: "ID", width: 80 } ] }); }); </script> </div> </body> </html>
掃描關(guān)注慧聚IT微信公眾號,及時獲取最新動態(tài)及最新資訊
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都網(wǎng)