jQuery EasyUI 數(shù)據(jù)網(wǎng)格 – 添加工具欄

2022-06-08 16:08 更新

jQuery EasyUI 數(shù)據(jù)網(wǎng)格 - 添加工具欄

本節(jié)將會(huì)在jQuery EasyUI數(shù)據(jù)網(wǎng)格(datagrid)中添加工具欄(toolbar)。

下述實(shí)例演示了向數(shù)據(jù)網(wǎng)格添加工具欄的操作。

創(chuàng)建數(shù)據(jù)網(wǎng)格(DataGrid)

	<table id="tt" class="easyui-datagrid" style="width:600px;height:250px" url="data/datagrid_data.json" 			
                       title="DataGrid with Toolbar" iconCls="icon-save" toolbar="#tb">
		<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>
	<div id="tb">
		<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:alert('Add')">Add</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cut" plain="true" onclick="javascript:alert('Cut')">Cut</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:alert('Save')">Save</a>
	</div>

我們不需要寫任何的javascript代碼,只需通過(guò)'toolbar'屬性附加工具欄到數(shù)據(jù)網(wǎng)格。

下載 jQuery EasyUI 實(shí)例

jeasyui-datagrid-datagrid4.zip

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)