Can anyone assist in getting my Grid working so that it pulls and displays 50 rows at a time? It currently displays 50 rows but does not show any page numbering. I have included a total of 120 in the datasource but do not know where to go from here. How do I display the page numbers and pass $start, $limit
variables to my query is is getting the data?
Where it should say "1 - 50 of 120 items" it says "No items to display"
Im stuck. :0(
var mydata = {"data":[
<?php foreach ($data_arr as $data){ ?>
{ "id": "<?php echo $data['id']; ?>", "name":"<?php echo $data['surname'] . ', ' . $data['firstname']; ?>", "company": "<?php echo $data['company']; ?>", "Email": "<?php echo $data['email']; ?>"},
<?php
}
?>
] , "total": <?=$total?>};
>
>
> $("#grid").kendoGrid({
> dataSource: {
> data: mydata.data,
> schema: {
> total: "total",
> model: {
> fields: {
> id: { type: "number" },
> name: { type: "string" },
> company: { type: "string" },
> email: { type: "email" }
> }
> }
> },
> pageSize: 50
> }, serverPaging: true,
> scrollable: false,
> sortable: true,
> filterable: true, selectable: "row",
> detailTemplate: kendo.template($("#detailTemplate").html()),
> detailInit: detailInit,
> pageable: {refresh: true,},
> columns: [
> {field:"id",title: "ID",filterable: false},
> {field: "name",title: "Name"},
> {field: "company",title: "Company"},
> {field: "email",title: "Email"}
> ]
> });
Then there's the server side PHP which does not seem to be getting anything from the URL all :
//get current page from URL
$get = $_SERVER['REQUEST_URI']; parse_str($get);
if(isset($page)){ $start = $page;$limit = $pagesize;
} $admin = new Admin();$count_data = $admin->countRows(); //brings back 120
$mydata= $admin->getRows($start=0,$limit=50);