jQuery EasyUI Data Grid - create complex toolbars

Data Grid (datagrid) toolbar (toolbar) can contain buttons and other components. You can pass a an existing DIV tags to easily custom toolbar layout, the DIV tag will become the content of the data grid (datagrid) toolbar. This tutorial will show you how to create complex data grid toolbar (datagrid) components.

Create a toolbar (Toolbar)

	<Div id = "tb" style = "padding: 5px; height: auto">
		<Div style = "margin-bottom: 5px">
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true"> </a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true"> </a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true"> </a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-cut" plain="true"> </a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true"> </a>
		</ Div>
		<Div>
			Date From: <input class = "easyui-datebox" style = "width: 80px">
			To: <input class = "easyui-datebox" style = "width: 80px">
			Language: 
			<Input class = "easyui-combobox" style = "width: 100px"
					url = "data / combobox_data.json"
					valueField = "id" textField = "text">
			<a href="#" class="easyui-linkbutton" iconCls="icon-search"> Search </a>
		</ Div>
	</ Div>

Creating a Data Grid (DataGrid)

	<Table class = "easyui-datagrid" style = "width: 600px; height: 250px"
			url = "data / datagrid_data.json" 
			title = "DataGrid - Complex Toolbar" toolbar = "# tb"
			singleSelect = "true" fitColumns = "true">
		<Thead>
			<Tr>
				<Th field = "itemid" width = "60"> Item ID </ th>
				<Th field = "productid" width = "80"> Product ID </ th>
				<Th field = "listprice" align = "right" width = "70"> List Price </ th>
				<Th field = "unitcost" align = "right" width = "70"> Unit Cost </ th>
				<Th field = "attr1" width = "200"> Address </ th>
				<Th field = "status" width = "50"> Status </ th>
			</ Tr>
		</ Thead>
	</ Table>

As you can see, the data grid (datagrid) toolbar Fields dialog box (dialog) similar. We do not need to write any javascript code, you can create a toolbar with complex data grid (datagrid).

Download jQuery EasyUI examples

jeasyui-datagrid-datagrid19.zip