JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Grid + Pagination+ PHP Problem
- This topic has 4 replies, 2 voices, and was last updated 2 years, 2 months ago by
svetoslav_borislavov.
-
AuthorPosts
-
June 17, 2022 at 6:44 am #103302
Joko Pitoyo
Participantwe have problem integration Grid with PHP, when pagination feature enabled, data not display, so we must trigger by code, below sample code
Smart(‘#gridGps’, class {
get properties() {
return {
dataSource: new window.Smart.DataAdapter({
dataSource: ‘/gps/list’,
dataSourceType: ‘json’,
dataFields: [
‘real_name: string’,
‘nopol: string’,
‘phone: string’,
‘imei: string’,
‘install_date: string’,
‘guaranty_date: string’
],
async: true
}),
sorting: {
enabled: true
},
grouping: {
enabled: true,
renderMode: ‘basic’
},
behavior: { columnResizeMode: ‘growAndShrink’ },
paging: {
enabled: true,
pageSize: 10,
pageIndex: 0
},
pager: {
visible: true
},
filtering: {
enabled: true
},
columns: [
{ label: ‘Pemilik’, dataField: ‘real_name’, width: 200 },
{ label: ‘Nopol’, dataField: ‘phone’, width: 200 },
{ label: ‘IMEI’, dataField: ‘imei’, width: 160 },
{ label: ‘Phone’, dataField: ‘phone’, cellsFormat: ‘d’, width: 120 },
{ label: ‘Tgl Installasi’, dataField: ‘install_date’, cellsFormat: ‘d’, width: 120 },
{ label: ‘Masa Garansi’, dataField: ‘guaranty_date’, width: 250 }
]
}
}
});setTimeout(function () {
document.getElementById(‘gridGps’).goToPage(0);
}, 1000);the problem is when enabled this setting:
paging: {
enabled: true,
pageSize: 10,
pageIndex: 0
},temporary solution is
setTimeout(function (){
document.getElementById(‘gridGps’).goToPage(0);
}, 1000);how to solve above problem?
-
This topic was modified 2 years, 2 months ago by
Joko Pitoyo.
-
This topic was modified 2 years, 2 months ago by
Joko Pitoyo.
June 17, 2022 at 1:56 pm #103311svetoslav_borislavov
ParticipantHi Joko,
I have copied your code and there is no problem with the pagination. Please check your version and update if available
Best Regards,
Svetoslav BorislavovSmart HTMLElements Team
https://www.htmlelements.com/June 17, 2022 at 5:05 pm #103312svetoslav_borislavov
ParticipantHi, Joko
Here is an example with the pagination feature of grid: https://codepen.io/svetoslavb04/pen/XWZQWMj
Best Regards,
Svetoslav BorislavovSmart HTMLElements Team
https://www.htmlelements.com/-
This reply was modified 2 years, 2 months ago by
svetoslav_borislavov.
June 17, 2022 at 10:42 pm #103316Joko Pitoyo
Participantyour sample does not using PHP as source data… so this no problem…. the problem happend when using php as source data…
June 20, 2022 at 2:43 pm #103320svetoslav_borislavov
ParticipantHi Joko,
Please remove the pageIndex property. Define only pageSize. It is 0 by default. I hope this helps!
Best Regards,
Svetoslav Borislavov
Smart HTMLElements Team
https://www.htmlelements.com/ -
This topic was modified 2 years, 2 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.