Loading ...
Sorry, an error occurred while loading the content.

Setting Datatable Record Set.

Expand Messages
  • German Escallon
    Hi all, How can I set the contents of my datatable instance without polling for the data again. Let s say I have a datatable, and the initial request retrieves
    Message 1 of 2 , May 4, 2009
    • 0 Attachment
      Hi all,

      How can I set the contents of my datatable instance without polling for
      the data again.
      Let's say I have a datatable, and the initial request retrieves 4000
      records (in JSON format). Retrieving and parsing this data takes a few
      seconds, which is OK at load time. Then, the user selects a different
      mode and the datasource retrieves 100 records, which are parsed and
      displayed in the datatable, replacing the previous 4000 records. At
      this point, the user goes back to the previous mode to display again the
      4000 records previously retrieved. How can I do this, without polling
      for the data again. More importantly, without parsing that data again,
      which I've noticed is the bottleneck of my operation.

      I've tried saving the recordset by doing something like this:

      var myRecSet = myDatatable.getRecordSet();

      The question is, how can I re-populate the datatable with the contents
      contained in that variable (myRecSet). I couldn't find a way of doing it.
      If you can think of a better approach, please let me know. Thanks in
      advance.

      ~G


      ______________________________________________________________________
      This email has been scanned by the MessageLabs Email Security System.
      For more information please visit http://www.messagelabs.com/email
      ______________________________________________________________________
    • satyam@satyam.com.ar
      Looking for performance improvements myself some time ago I was quite amazed to find that when refreshing the DataTable, the bottleneck was not so much in
      Message 2 of 2 , May 4, 2009
      • 0 Attachment
        Looking for performance improvements myself some time ago I was quite
        amazed to find that when refreshing the DataTable, the bottleneck was not
        so much in retrieving the data, as I assumed, but in formatting the page.
        It is easy to see if you ask for the same page in IE (at least prior to 8,
        I don't know if they finally got it right now) and Firefox, for the same
        communication delay you'll see quite a difference in rendering time.

        The best and easiest solution for performance is to use client-side paging,
        another clue that the issue is of rendering. Client-side paging does not
        make any difference in transmission time since it retrieves the whole 4000
        records at once, but it makes an enourmous difference in formatting time,
        and you will notice it.

        Another way to improve the user perception of responsiveness, though not
        the actual speed, is to set the renderLoopSize configuration attribute. If
        you set it to, say, 200, that many records will show quite fast and the UI
        will be unfrozen, the user will be able to see those records, scroll
        around, while the next 200 records get ready. Overall, it will take longer
        to display the whole thing, but the user perception changes dramatically
        since he will see the first batch of results much faster.

        Finally, the DataSource supports caching, there is a configuration
        attribute, maxCache...something, but that will give you trouble with
        dynamic data since it won't check for refreshes.

        Satyam

        On Mon, 04 May 2009 17:28:20 -0400, German Escallon <germane@...>
        wrote:
        > Hi all,
        >
        > How can I set the contents of my datatable instance without polling for
        > the data again.
        > Let's say I have a datatable, and the initial request retrieves 4000
        > records (in JSON format). Retrieving and parsing this data takes a few
        > seconds, which is OK at load time. Then, the user selects a different
        > mode and the datasource retrieves 100 records, which are parsed and
        > displayed in the datatable, replacing the previous 4000 records. At
        > this point, the user goes back to the previous mode to display again the
        > 4000 records previously retrieved. How can I do this, without polling
        > for the data again. More importantly, without parsing that data again,
        > which I've noticed is the bottleneck of my operation.
        >
        > I've tried saving the recordset by doing something like this:
        >
        > var myRecSet = myDatatable.getRecordSet();
        >
        > The question is, how can I re-populate the datatable with the contents
        > contained in that variable (myRecSet). I couldn't find a way of doing
        it.
        > If you can think of a better approach, please let me know. Thanks in
        > advance.
        >
        > ~G
        >
        >
        > ______________________________________________________________________
        > This email has been scanned by the MessageLabs Email Security System.
        > For more information please visit http://www.messagelabs.com/email
        > ______________________________________________________________________
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.