Latest web development tutorials
×

jQuery EasyUI Tutorial

jQuery EasyUI Tutorial jQuery EasyUI Introduction

jEasyUI application

jEasyUI Create a CRUD application jEasyUI Create a CRUD data grid jEasyUI Form CRUD application jEasyUI Create an RSS reader

jEasyUI Drag and drop

jEasyUI Basic drag and drop jEasyUI Create a drag-and-drop shopping cart jEasyUI Create a school curriculum

jEasyUI Menus and buttons

jEasyUI Create a simple menu jEasyUI Create a link button jEasyUI Create a menu button jEasyUI Create a split button

jEasyUI layout

jEasyUI Create a border layout jEasyUI Create a complex layout jEasyUI Creates a fold panel jEasyUI Create a tab page jEasyUI Dynamically add a tab jEasyUI Add the AutoPlay tab jEasyUI Create the XP style left panel

jEasyUI Data grid

jEasyUI Convert HTML tables to data grids jEasyUI Get the selected row data jEasyUI Add the query function jEasyUI Add a toolbar jEasyUI Create complex toolbars jEasyUI Sets the frozen column jEasyUI Dynamically change columns jEasyUI Format the column jEasyUI Set sort jEasyUI Custom sorting jEasyUI Create a column combination jEasyUI Add a check box jEasyUI Custom tab jEasyUI Enable in-line editing jEasyUI Extension editor jEasyUI Column operation jEasyUI Merge Cells jEasyUI Create a custom view jEasyUI Create a footer summary jEasyUI Condition Sets the line background color jEasyUI Create an attribute grid jEasyUI The extended line shows the details jEasyUI Create a subgrid jEasyUI Display massive data jEasyUI Add a paging component

jEasyUI window

jEasyUI Create a simple window jEasyUI Customize the Window Toolbar jEasyUI Window and layout jEasyUI Create a dialog box jEasyUI Customize the dialog box

jEasyUI Tree menu

jEasyUI Use the markup to create a tree menu jEasyUI Create an asynchronous tree menu jEasyUI Tree menu to add nodes jEasyUI Create a tree menu with check boxes jEasyUI Tree menu drag and drop control jEasyUI The Tree menu loads the parent / child nodes jEasyUI Create the base tree grid jEasyUI Create a complex tree grid jEasyUI Dynamic loading of tree jEasyUI The tree grid adds pagination jEasyUI Tree-lazy lazy-loading node

jEasyUI Form

jEasyUI Create an asynchronous submission form jEasyUI Form validation jEasyUI Create a tree drop-down box jEasyUI Format the drop-down box jEasyUI Filter down the data grid

jEasyUI Reference Manual

jQuery EasyUI Plugin jQuery EasyUI Extended

jQuery EasyUI Extended - Data Grid View

jQuery EasyUI Extended jQuery EasyUI Extended

Detailed view of the data grid (DataGrid DetailView)

usage

Step 1: Create an HTML page

	<Head>
		<Script type = "text / javascript" src = "datagrid-detailview.js"> </ script>
	</ Head>
	<Body>
		<Table id = "tt"> </ table>
	</ Body>

Step 2: Create a Data Grid (DataGrid)

	$ ( '# Tt'). Datagrid ({
		title: 'DataGrid - DetailView',
		width: 500,
		height: 250,
		remoteSort: false,
		singleSelect: true,
		nowrap: false,
		fitColumns: true,
		url: 'datagrid_data.json',
		columns: [[
			{Field: 'itemid', title: 'Item ID', width: 80},
			{Field: 'productid', title: 'Product ID', width: 100, sortable: true},
			{Field: 'listprice', title: 'List Price', width: 80, align: 'right', sortable: true},
			{Field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right', sortable: true},
			{Field: 'attr1', title: 'Attribute', width: 150, sortable: true},
			{Field: 'status', title: 'Status', width: 60, align: 'center'}
		]],
		view: detailview,
		detailFormatter: function (rowIndex, rowData) {
			return '<table> <tr>' +
					'<Td rowspan = 2 style = "border: 0"> <img src = "images /' + rowData.itemid + '.png" style = "height: 50px;"> </ td>' +
					'<Td style = "border: 0">' +
					'<P> Attribute:' + rowData.attr1 + '</ p>' +
					'<P> Status:' + rowData.status + '</ p>' +
					'</ Td>' +
					'</ Tr> </ table>';
		}
	});

Attributes

名称 类型 描述 默认值
detailFormatter function(index,row) 返回行明细内容的格式化函数。

event

名称 参数 描述
onExpandRow index,row 当展开一行时触发。
onCollapseRow index,row 当折叠一行时触发。

method

名称 参数 描述
fixDetailRowHeight index 固定明细行的高度。
getExpander index 获取行扩展对象。
getRowDetail index 获取行明细容器。
expandRow index 展开一行。
collapseRow index 折叠一行。

Packet data grid view (DataGrid GroupView)

usage

Step 1: Create an HTML page

	<Head>
		<Script type = "text / javascript" src = "datagrid-groupview.js"> </ script>
	</ Head>
	<Body>
		<Table id = "tt"> </ table>
	</ Body>

Step 2: Create a Data Grid (DataGrid)

	$ ( '# Tt'). Datagrid ({
		title: 'DataGrid - GroupView',
		width: 500,
		height: 250,
		rownumbers: true,
		remoteSort: false,
		nowrap: false,
		fitColumns: true,
		url: 'datagrid_data.json',
		columns: [[
			{Field: 'productid', title: 'Product ID', width: 100, sortable: true},
			{Field: 'listprice', title: 'List Price', width: 80, align: 'right', sortable: true},
			{Field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right', sortable: true},
			{Field: 'attr1', title: 'Attribute', width: 150, sortable: true},
			{Field: 'status', title: 'Status', width: 60, align: 'center'}
		]],
		groupField: 'productid',
		view: groupview,
		groupFormatter: function (value, rows) {
			return value + '-' + rows.length + 'Item (s)';
		}
	});

Attributes

名称 类型 描述 默认
groupField string 指示要被分组的字段。
groupFormatter function(value,rows) 返回分组内容的格式化函数。
value 参数指示由 'groupField' 属性定义的分组值。
rows 参数根据指定分组值指示数据行。

method

名称 参数 描述
expandGroup groupIndex 展开一个分组。
collapseGroup groupIndex 折叠一个分组。

Data Grid Caching view (DataGrid BufferView)

Step 1: Contains 'datagrid-bufferview.js' file

	<Head>
		<Script type = "text / javascript" src = "datagrid-bufferview.js"> </ script>
	</ Head>

Step 2: Create a Data Grid (DataGrid)

	<Table id = "tt" class = "easyui-datagrid" style = "width: 700px; height: 250px"
			title = "DataGrid - BufferView" 
			data-options = "url: 'get_data.php', view: bufferview, rownumbers: true, singleSelect: true, autoRowHeight: false, pageSize: 50">
		<Thead>
			<Tr>
				<Th field = "inv" width = "80"> Inv No </ th>
				<Th field = "date" width = "100"> Date </ th>
				<Th field = "name" width = "80"> Name </ th>
				<Th field = "amount" width = "80" align = "right"> Amount </ th>
				<Th field = "price" width = "80" align = "right"> Price </ th>
				<Th field = "cost" width = "100" align = "right"> Cost </ th>
				<Th field = "note" width = "110"> Note </ th>
			</ Tr>
		</ Thead>
	</ Table>

Data Grid virtual scroll view (DataGrid VirtualScrollView)

Step 1: Contains 'datagrid-scrollview.js' file

	<Head>
		<Script type = "text / javascript" src = "datagrid-scrollview.js"> </ script>
	</ Head>

Step 2: Create a Data Grid (DataGrid) to scroll through a virtual view

	<Table id = "tt" class = "easyui-datagrid" style = "width: 700px; height: 250px"
			title = "DataGrid - VirtualScrollView"
			data-options = "url: 'get_data.php', view: scrollview, rownumbers: true, singleSelect: true, autoRowHeight: false, pageSize: 50">
		<Thead>
			<Tr>
				<Th field = "inv" width = "80"> Inv No </ th>
				<Th field = "date" width = "100"> Date </ th>
				<Th field = "name" width = "80"> Name </ th>
				<Th field = "amount" width = "80" align = "right"> Amount </ th>
				<Th field = "price" width = "80" align = "right"> Price </ th>
				<Th field = "cost" width = "100" align = "right"> Cost </ th>
				<Th field = "note" width = "110"> Note </ th>
			</ Tr>
		</ Thead>
	</ Table>

Download jQuery EasyUI examples

jquery-easyui-datagridview.zip


jQuery EasyUI Extended jQuery EasyUI Extended