jQWidgets Forums

jQuery UI Widgets Forums Grid Array size growing on pagination

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Array size growing on pagination #53333

    Shankar
    Participant

    Hi

    I am preparing a jqxGrid with the below properties for pagination.

    pageable: true,
    virtualmode: true,
    rendergridrows: function (obj) {
    return dataAdapter.records;
    }

    For example if I am getting a total record count of 150 for a given filter condition and if I directly jump to last page ( say page size 10 ) i.e 15 on load of the grid( I will return those records from the server which should be there in page 15 ) OR if I navigate to 15th page by using the arrow buttons for pagination ( returning records from server according to the ‘pagenum’ request parameter ) then if I see the array that stores the records has grown to 150 out of which 1 to 140 are not having any data and only 140 to 150 have data. Is this expected behavior in order the pagination to work or Will this have any affect on the browser memory when we are dealing with millions of records and when we are on the last page ?

    Thanks
    Shankar

    Array size growing on pagination #53357

    Peter Stoev
    Keymaster

    Hi Shankar,

    Please, look at the PHP demos available in the Demos section and especially the one with Server Paging & Filtering.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Array size growing on pagination #53374

    Shankar
    Participant

    Hi Peter

    I have implemented pagination by seeing those PHP demos and it is working fine. My question is about the java script array ( which jqxGrid plugin prepares for the adapter or for the grid itself ) to hold the data. I am returning 10 records ( say page size 10 ) per page correctly from server side and it is getting stored in the data array properly, but for example if I am on page 15 then I will return 10 records from server from 141 to 150 which are stored in array indices of 140 to 149. But the array objects from 0 to 139 are null/doesn’t contain any data. So if I implement pagination say for 1,50,000 records and if I am on the last page then the java script array might have grown that big ( 1,50,000 ) to hold only 10 records for that page. Will this be a problem with the browser memory ?

    Thanks
    Shankar

    Array size growing on pagination #53375

    Peter Stoev
    Keymaster

    Hi Shankar,

    No, it won’t be a problem, because you don’t create 1 million items, you create an array with 10 items.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.