Simple Paging Grid Extjs

This tutorial just sharing about how to load data from database using json and then display that data in grid. In addition, in this section we will learn about how to make paging grid in extjs. here i will explaint part of code to make this tutorial. ok, the first we start from javascript file:

this is the main code to created paging,

bbar: new Ext.PagingToolbar(
{
pageSize: 6,
store: store,
displayInfo: true,
emptyMsg: "No data to display"
 })

second step we need php file to load data from database, and limit the data. here part of code this file.

$query = "SELECT * FROM simpleform";
$result = mysql_query($query);
$nbrows = mysql_num_rows($result);
$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);
$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);
$limit = $query." limit ".$start.",".$end;
$result = mysql_query($limit);  	

if($nbrows>0)
{
while($rec = mysql_fetch_array($result))
{
$arr[] = $rec;
}
$jsonresult = json_encode($arr);

echo '({"total":"'.$nbrows.'","results":'.$jsonresult.'})';
}
else
{
echo '({"total":"0", "results":""})';
 }

this is screen shot

simple-paging-grid

http://www.ziddu.com/download/9454747/simplepaginggrid.zip.html

Recent Search Term
extjs grid paging|extjs paging|extjs paging grid|extjs grid pagination|paging in Extjs|paging extjs|extjs pagination|simple extjs grid|extjs simple paging grid|ext js checkboxsel paging|
Popular Search Term gantz 322|plkn semakan calon 2011|morakiacom|read gantz 322|Gantz 322|

One Response to “Simple Paging Grid Extjs”

  1. Nice, very helpfull! Thanks!

Leave a Reply