jQuery UI Widgets Forums Grid Column Names in Json response

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 13 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Column Names in Json response #4254

    paolo.macor
    Member

    Hello,
    i setup some grids to show db data through json, extracted by php code provided in the examples found in the downloaded pakage and on this website.
    As I can see, json response to the grid repeats fiels name in every record it returns, and this is going to consume lots of memory in php (json_encode function) and I have to reconfigure php.ini to hold such an amount of memory when large dataset are returned.
    Is there a way, or an example to study in which column names are mapped once, end then only data is ruturned?
    Thanks,
    Paolo

    Column Names in Json response #4255

    Peter Stoev
    Keymaster

    Hi Paolo,

    The json_encode function returns an array of records. Each record has fields with values. The Grid reads a record and get the cell value depending on the field name. If you have a Large Data Set, I think that it is better to use Server Side Paging instead of returning all records at once. Using that approach, you will return an array of ~10 records which will not consume large amount of memory. Another way is to use some custom approach and populate the Grid locally from basic Array. However, with that approach you will have to manually map the JSON to Array.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.