https://jingyan.baidu.com/article/4e5b3e199a114ad1911e2438.html
想要固定某一行的話,以凍結第四行窗口為例,鼠標點擊第五行,點擊菜單欄中的【視圖】→【凍結窗口】→【凍結拆分窗格】
批量操作
Match函數 :查找值 區域
擊“了解更多”獲取Kendo UI for jQuery R1 2020 SP1試用版下載
Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四個控件。Kendo UI for jQuery是創建現代Web應用程序的最完整UI庫。
鎖定(凍結)列使您可以在用戶水平滾動網格時始終顯示特定列。
有關可運行的示例,可參閱有關在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: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
schema: {
model: {
fields: {
OrderID: { type: "number" },
ShipCountry: { type: "string" },
ShipName: { type: "string" },
ShipCity: { type: "string" },
ShipAddress: { type: "string" }
}
}
},
pageSize: 30
},
height: 540,
sortable: true,
reorderable: true,
groupable: true,
resizable: true,
filterable: true,
columnMenu: true,
pageable: true,
columns: [ {
field: "OrderID",
title: "Order ID",
locked: true,
lockable: false,
width: 150
}, {
field: "ShipCountry",
title: "Ship Country",
width: 300
}, {
field: "ShipCity",
title: "Ship City",
width: 300
},{
field: "ShipName",
title: "Ship Name",
locked: true,
width: 300
}, {
field: "ShipAddress",
lockable: false,
width: 400
}
]
});
});
</script>
</div>
</body>
</html>
為了使該功能正常運行,必須提供以下配置設置。 它們確保至少一個非鎖定列始終可見,并且可以水平滾動非鎖定列。 如果預期的水平空間不足,則不會出現水平滾動條。
注意:
鎖定的列無法觸摸滾動,因為它們被封裝在一個具有溢出:隱藏樣式的容器中。 要解決臺式機設備上的此限制,請使用mousewheel事件。 但是,觸摸設備不存在任何解決方法。
鎖定列依賴于同步網格的凍結和非凍結部分的行高,某些瀏覽器(例如Internet Explorer 9和Firefox)要求以像素為單位設置行高樣式。 否則,由于子像素問題,同步可能無法正常工作。
div.k-grid td
{
line-height: 18px;
}
當您實現自定義代碼并依靠選擇器或以Grid表為目標時,Grid為其鎖定和可滾動部分創建單獨的表。 鎖定列位于.k-grid-content-locked元素內,而可滾動內容位于.k-grid-content元素內。
Query EasyUI最新試用版免費下載>
本教程演示了如何凍結一些列,當用戶在網格上水平移動滾動條時,凍結列不能滾動到視圖的外部。
想要定義凍結列,首先您應該定義frozenColumns屬性。frozenColumn屬性和columns屬性是一樣的。
$('#tt').datagrid({ title:'Frozen Columns', iconCls:'icon-save', width:500, height:250, url:'data/datagrid_data.json', frozenColumns:[[ {field:'itemid',title:'Item ID',width:80}, {field:'productid',title:'Product ID',width:80}, ]], columns:[[ {field:'listprice',title:'List Price',width:80,align:'right'}, {field:'unitcost',title:'Unit Cost',width:80,align:'right'}, {field:'attr1',title:'Attribute',width:100}, {field:'status',title:'Status',width:60} ]] });
您不需要編寫任何javascript代碼,如下所示,就能創建一個數據網格組件:
Item ID | Product ID | ||
---|---|---|---|
List Price | Unit Cost | Attribute | Stauts |
下載該EasyUI示例:easyui-datagrid-demo.zip
購買最新正版授權!"咨詢在線客服"
2015歲末掃尾之戰!全球廠商攜手放利!
本站文章除注明轉載外,均為本站原創或翻譯
*請認真填寫需求信息,我們會在24小時內與您取得聯系。