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

Avoid page flickering when updating a DataTable

Expand Messages
  • alessandro_bozzon
    Hi there I have the following problem: upon user input, I d like to refresh the content of a data table by calling the sendRequest method of its underlying
    Message 1 of 2 , Oct 30, 2009
    • 0 Attachment
      Hi there

      I have the following problem: upon user input, I'd like to refresh the content of a data table by calling the "sendRequest" method of its underlying data source.

      RT.getDataSource().sendRequest('', {
      success: RT.onDataReturnInitializeTable,
      failure: RT.onDataReturnInitializeTable,
      scope: RT,
      argument: RT.getState()});

      Everything works fine, but with the unpleasant side effect of a page flickering (i.e., if the datatable is in the middle of the page, the page is automatically scrolled to the top). I made sure that the problem is not coming from the event triggered by the user input as I prevent the default event with the YAHOO.util.Event.preventDefault method.

      I therefore suspect that there must be some event triggered within the datatable code, but I can't find it.

      Any idea?

      I'm using YUI 2.8 and testing on Firefox 3.5.

      Thank you
    • Satyam
      You are actively refreshing the DataTable, what would you expect? How could it be otherwise? You might, however, change the logic and send a timestamp of the
      Message 2 of 2 , Oct 30, 2009
      • 0 Attachment
        You are actively refreshing the DataTable, what would you expect? How
        could it be otherwise? You might, however, change the logic and send a
        timestamp of the latest batch of changes and ask if there are any news
        before doing a pointless request. You might also go through all the
        logic required on both ends to do differential updates, but if you ask
        the DataTable to refresh, it will.

        Satyam

        alessandro_bozzon escribió:
        > Hi there
        >
        > I have the following problem: upon user input, I'd like to refresh the content of a data table by calling the "sendRequest" method of its underlying data source.
        >
        > RT.getDataSource().sendRequest('', {
        > success: RT.onDataReturnInitializeTable,
        > failure: RT.onDataReturnInitializeTable,
        > scope: RT,
        > argument: RT.getState()});
        >
        > Everything works fine, but with the unpleasant side effect of a page flickering (i.e., if the datatable is in the middle of the page, the page is automatically scrolled to the top). I made sure that the problem is not coming from the event triggered by the user input as I prevent the default event with the YAHOO.util.Event.preventDefault method.
        >
        > I therefore suspect that there must be some event triggered within the datatable code, but I can't find it.
        >
        > Any idea?
        >
        > I'm using YUI 2.8 and testing on Firefox 3.5.
        >
        > Thank you
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.423 / Virus Database: 270.14.39/2468 - Release Date: 10/29/09 19:49:00
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.