YUI: Refresh DataTable - Method 2
- Posted by admin on March 1st, 2007 filed in javascript
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.
Related











August 27th, 2008 at 4:52 pm
Code does not work.