99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

jQuery EasyUI 數據網格 – 條件設置行背景顏色

2022-06-08 16:22 更新

jQuery EasyUI 數據網格 - 條件設置行背景顏色

本節(jié)中的示例將根據不同的設置條件來對jQuery EasyUI數據網格(datagrid)中行的樣式進行更改。當將listprice的值設置為大于50時,我們將為該行設置不同的顏色。

數據網格的rowStyler函數的設計目的是允許您自定義行樣式。以下代碼展示如何改變行樣式:

	<table id="tt" title="DataGrid" style="width:600px;height:250px" 			url="data/datagrid_data.json" 			singleSelect="true" fitColumns="true">
		<thead>
			<tr>
				<th field="itemid" width="80">Item ID</th>
				<th field="productid" width="80">Product ID</th>
				<th field="listprice" width="80" align="right">List Price</th>
				<th field="unitcost" width="80" align="right">Unit Cost</th>
				<th field="attr1" width="150">Attribute</th>
				<th field="status" width="60" align="center">Stauts</th>
			</tr>
		</thead>
	</table>
	$('#tt').datagrid({
		rowStyler:function(index,row){
			if (row.listprice>50){
				return 'background-color:pink;color:blue;font-weight:bold;';
			}
		}
	});

正如您所看到的,我們根據一些條件設置background-color(背景色)為pink(粉紅色),設置文本顏色為blue(藍色)。

下載 jQuery EasyUI 實例

jeasyui-datagrid-datagrid18.zip

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號