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 row drop

jQuery EasyUI Extended jQuery EasyUI Extended

usage

It contains 'datagrid-dnd.js' file

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

Enable dragging and placing

	<Table class = "easyui-datagrid" title = "DataGrid" style = "width: 700px; height: 250px" data-options = "
				singleSelect: true,
				data: data,
				onLoadSuccess: function () {
					$ (This) .datagrid ( 'enableDnd');
				}
			">
		<Thead>
			<Tr>
				<Th data-options = "field: 'itemid', width: 80"> Item ID </ th>
				<Th data-options = "field: 'productid', width: 100"> Product </ th>
				<Th data-options = "field: 'listprice', width: 80, align: 'right'"> List Price </ th>
				<Th data-options = "field: 'unitcost', width: 80, align: 'right'"> Unit Cost </ th>
				<Th data-options = "field: 'attr1', width: 250"> Attribute </ th>
				<Th data-options = "field: 'status', width: 60, align: 'center'"> Status </ th>
			</ Tr>
		</ Thead>
	</ Table>

event

The event extended from the data grid (datagrid), the following are events for the data grid (datagrid) added.

名称 参数 描述
onBeforeDrag row 当一行的拖拽开始前触发,返回 false 则取消拖拽。
onStartDrag row 当开始拖拽一行时触发。
onStopDrag row 当停止拖拽一行后触发。
onDragEnter targetRow, sourceRow 当拖拽一行进入某允许放置的目标行时触发,返回 false 则取消放置。
onDragOver targetRow, sourceRow 当拖拽一行在某允许放置的目标行上时触发,返回 false 则取消放置。
onDragLeave targetRow, sourceRow 当拖拽一行离开某允许放置的目标行时触发。
onBeforeDrop targetRow,sourceRow,point 当一行被放置前触发,返回 false 则取消放置。
targetRow:放置的目标行。
sourceRow:拖拽的源行。
point:指示放置的位置,可能的值:'top' 或 'bottom'。
onDrop targetRow,sourceRow,point 当一行被放置时触发。
targetRow:放置的目标行。
sourceRow:拖拽的源行。
point:指示放置的位置,可能的值:'top' 或 'bottom'。

method

The methods extend from the data grid (datagrid).

名称 参数 描述
enableDnd index 启用行的拖拽与放置。
'index' 参数指示要被拖拽与放置的行。
如果该参数未指定,则拖拽与放置所有行。

代码实例:

$('#dg').datagrid('enableDnd', 1);	// enable dragging on second row
$('#dg').datagrid('enableDnd');	// enable dragging all rows

Download jQuery EasyUI examples

jquery-easyui-datagrid-dnd.zip


jQuery EasyUI Extended jQuery EasyUI Extended