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

Re: Disarmed?: Renewed cry for help with datatable and 2.5.1

Expand Messages
  • y_lsmith
    ... Bret, Since you re modifying the RecordSet, then rendering, it s probably more efficient to just call the RecordSet s replaceRecords
    Message 1 of 4 , Mar 31, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "bretlevy" <bret@...> wrote:
      >
      >
      > Hello all:
      >
      > I guess I answered my own question by looking at the actual
      > initializeTable() implementation in 241 v. 251. In 241, the method
      > takes a parameter (the new records) and does all the restting and
      > calls addRows() with the records. 251 DOES NOT accept the (any)
      > parameter and it DOES NOT call addRows().
      >
      > So I changed my logic from calling initializeTable at all, and I just
      > call addRows instead. This, of course, added the rows to the ones
      > already there, so I needed a deleteRows first.
      >
      > Now my code looks like this:
      >
      > tblobject.deleteRows (0, pager.size);
      > tblobject.addRows (RESULT.data.rows);

      Bret,

      Since you're modifying the RecordSet, then rendering, it's probably more efficient to just call the RecordSet's replaceRecords  method:

      tblobject.getRecordSet().replaceRecords(RESULT.data.rows);
      tblobject.render();


      Of course, if you support cell selection, then you'll probably want to use:

      tblobject.initializeTable();
      tblobject.getRecordSet().addRecords(RESULT.data.rows);
      tblobject.render();

      Take a look at the DataTable's onDataReturn methods .  Maybe there's something in there that might work for you.

      Hope this helps,
      Luke
    Your message has been successfully submitted and would be delivered to recipients shortly.