1 Reply Latest reply on May 9, 2009 12:19 PM by Michael Borbor

    XMLListCollection getItemAt() question




      I am not sure if I am doing something wrong, but I am trying to get a datagrid to page using 'next' and 'previous' buttons. I am loading an external xml file, and would like to break it down into smaller 25-row sections and page through them.


      I have created the whole page, but I am trying to use getItemAt(entry_id, limit); to select the section I want. If limit was set to 25, and entry_id was set to 50, then I would expect it to display entries 50 through 75 after calling refresh(). However, it seems I do not completely understand the getItemAt() method because it is not doing what I intend.







      function display():void {

      entry_id= (limit*page_current)-limit;

      requestData.getItemAt(entry_id, limit);




      Perhaps I am expecting it to work like a mySQL statement (LIMIT 50, 25) at it doesn't. Or maybe it is getting the rows, but I need to clear the current results and display only the items that have been retrieved. I tried replacing getItemAt() with removeAll() to see if the refresh would work and it did; all of the datagrid entries vanished, so there must be something I am doing wrong with getItemAt().


      Help is mucho appreciated,