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
http://www.ziddu.com/download/9454747/simplepaginggrid.zip.html

Nice, very helpfull! Thanks!