Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #103302
    Joko Pitoyo
    Participant

    we 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 1 year, 10 months ago by Joko Pitoyo.
    • This topic was modified 1 year, 10 months ago by Joko Pitoyo.
    #103311

    Hi 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 Borislavov

    Smart HTMLElements Team
    https://www.htmlelements.com/

    #103312

    Hi, Joko

    Here is an example with the pagination feature of grid: https://codepen.io/svetoslavb04/pen/XWZQWMj

    Best Regards,
    Svetoslav Borislavov

    Smart HTMLElements Team
    https://www.htmlelements.com/

    #103316
    Joko Pitoyo
    Participant

    your sample does not using PHP as source data… so this no problem…. the problem happend when using php as source data…

    #103320

    Hi 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/

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.