Hello,
I have an issue pretty weird with PageSize of Grid. When I set page size to 2 and I have more elements, in the pager, there is only one page instead of 3 or 4 but when I do sort or group, all pages in the pager appear.
I attach a video.
Am I doing something wrong?
This is the code Javascript:
This is the code of dataSourceJson.php:
Thank you,
Daniel
I have an issue pretty weird with PageSize of Grid. When I set page size to 2 and I have more elements, in the pager, there is only one page instead of 3 or 4 but when I do sort or group, all pages in the pager appear.
I attach a video.
Am I doing something wrong?
This is the code Javascript:
$(document).ready(
function
() {
var
dataSource =
new
kendo.data.DataSource({
pageSize: 2,
transport: {
read:
"dataSourceJson.php"
},
schema: {
data:
"data"
},
error:
function
(e) {
// handle event
alert(
"error"
);
},
change:
function
(e) {
// handle event
//alert("change");
}
});
$(
"#grid"
).kendoGrid({
dataSource: dataSource,
pageable:
true
,
groupable:
true
,
scrollable:
true
,
sortable:
true
,
pageable:
true
});
$(
"#search"
).click(
function
() {
var
Grid = $(
"#grid"
).data(
"kendoGrid"
);
var
data = Grid.dataSource_data;
dataSource.read();
});
});
This is the code of dataSourceJson.php:
<?php
$array
= Array(Array(
"from_user"
=>
"daniel"
,
"from_user_id"
=>
"1"
),
Array(
"from_user"
=>
"daniel"
,
"from_user_id"
=>
"1"
),
Array(
"from_user"
=>
"daniel"
,
"from_user_id"
=>
"1"
),
Array(
"from_user"
=>
"daniel"
,
"from_user_id"
=>
"1"
),
Array(
"from_user"
=>
"daniel"
,
"from_user_id"
=>
"1"
),
Array(
"from_user"
=>
"daniel"
,
"from_user_id"
=>
"1"
));
header(
'Content-Type: application/json; charset=iso-8859-1'
);
echo
"{\"data\":"
.json_encode(
$array
).
"}"
;
?>
Thank you,
Daniel