YUI: Refresh DataTable - Method 2

As mentioned in the previous post the way I refreshed a datatable widget after a change in the data was to reinstantiate the table. The way I did this was to simply make my widgets configuration and creation into a functin which I could then call at will whenever I needed it to take on new data.

However, a new method has sprang up that seems much better. Although slightly less intuitive. There’s a method called

 
myDataTable.getRecordSet().replace(newData);  // replaces the data with the newest set
myDataTable.paginateRows();  // re-paginates the table
myDataTable.showPage(0);  // shows first page
 

This also executes marginally faster than rebuilding the entire table.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google
  • BlinkList
  • description
  • Live
  • Ma.gnolia
  • Reddit
  • Slashdot
  • SphereIt
  • StumbleUpon

Related

del.icio.us:YUI: Refresh DataTable - Method 2 digg:YUI: Refresh DataTable - Method 2 spurl:YUI: Refresh DataTable - Method 2 wists:YUI: Refresh DataTable - Method 2 simpy:YUI: Refresh DataTable - Method 2 newsvine:YUI: Refresh DataTable - Method 2 blinklist:YUI: Refresh DataTable - Method 2 furl:YUI: Refresh DataTable - Method 2 reddit:YUI: Refresh DataTable - Method 2 fark:YUI: Refresh DataTable - Method 2 blogmarks:YUI: Refresh DataTable - Method 2 Y!:YUI: Refresh DataTable - Method 2 smarking:YUI: Refresh DataTable - Method 2 magnolia:YUI: Refresh DataTable - Method 2 segnalo:YUI: Refresh DataTable - Method 2 gifttagging:YUI: Refresh DataTable - Method 2

One Response to “YUI: Refresh DataTable - Method 2”

  1. Anonymous Says:

    Code does not work.

Leave a Comment