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 Data Grid - Using the virtual scroll view displays mass data

Data Grid (datagrid) virtual scrolling feature can be used to display a large number of records without paging. When the vertical scroll bar to scroll the data grid (datagrid) Executive ajax request to load and refresh the existing records. Refresh the entire course of action is smooth not blinking. In this tutorial, we will create a data grid (datagrid), and use the virtual scrolling feature to load data from the server.

Creating a Data Grid (DataGrid)

Grid data (datagrid) using virtual scrolling feature, 'view' property should be set to 'scrollview'. Users should download scrollview extended from the data grid (datagrid), and reference scrollview file page header.

<Script type = "text / javascript" src = "http://www.w3cschool.cc/try/jeasyui/datagrid-detailview.js"> </ script>
<Table id = "tt" class = "easyui-datagrid" style = "width: 700px; height: 300px"
		title = "DataGrid - VirtualScrollView"
		data-options = "view: scrollview, rownumbers: true, singleSelect: true,
			url: 'datagrid27_getdata.php', 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>

Please note that we do not need to use the pagination property, but pageSize attribute is required, so that execution ajax request data grid (datagrid) for the specified number of records from the server.

Server-side code

datagrid27_getdata.php

? $ Page = isset ($ _ POST [ 'page']) intval ($ _ POST [ 'page']): 1;
$ Rows = isset ($ _ POST [ 'rows']) intval ($ _ POST [ 'rows']):? 50;

$ Items = array ();
date_default_timezone_set ( 'UTC');
for ($ i = 1; $ i <= $ rows; $ i ++) {
	$ Index = $ i + ($ page-1) * $ rows;
	$ Amount = rand (50,100);
	$ Price = rand (10000,20000) / 100;
	$ Items [] = array (
		'Inv' => sprintf ( "INV% 04d", $ index),
		'Date' => date ( 'Ym-d', time () + 24 * 3600 * $ i),
		'Name' => 'Name'. $ Index,
		'Note' => 'Note'. $ Index,
		'Amount' => $ amount,
		'Price' => sprintf ( '% 01.2f', $ price),
		'Cost' => sprintf ( '% 01.2f', $ amount * $ price)
	);
}
$ Result = array ();
$ Result [ 'total'] = 8000;
$ Result [ 'rows'] = $ items;
echo json_encode ($ result);

Download jQuery EasyUI examples

jeasyui-datagrid-datagrid27.zip