Here is my thread ,i posted the actual problem of paging here in this area. you can help me from this thread sencha forum sencha forum Ext Paging problem with EXt direct Grid panel


Here is my thread ,i posted the actual problem of paging here in this area. you can help me from this thread sencha forum sencha forum Ext Paging problem with EXt direct Grid panel


On
Finally i got the answer from the forum
My Store Js
var store = Ext.create('Ext.data.Store', {
model : 'Users',
remoteSort : true,
autoLoad : true,
pageSize: 5, // items per page
sorters : [{
property : 'name',
direction : 'ASC'
}],
proxy : {
type : 'direct',
directFn : 'Users.showAllUsers',
reader: {
root: 'users'
}
}
});
My PHP function
function showAllUsers($params)
{
$sort = $params->sort[0];
$field = $sort->property;
$direction = $sort->direction;
$start = $params->start;
$end = $params->limit;
($direction == 'ASC' ? 'ASC' : 'DESC');
$dbh = Dbconfig::dbconnect();
$stmt = $dbh->prepare("SELECT count(*) FROM users");
$stmt->execute();
$number_of_rows = $stmt->fetchColumn();
$sth = $dbh->prepare("SELECT * FROM users ORDER BY name $direction LIMIT $start,$end");
$sth->execute();
$dataAll = $sth->fetchAll();
$data = array(
"success" => mysql_errno() == 0,
"total" => $number_of_rows,
"users" => $dataAll
);
return $data;
}
Below is the sample on how your store and sample results should be so that your pagination works as required.
Store should look like below
and the results from your server should be like