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

31847Re: Issue with addRow() and pagination

Expand Messages
  • y_lsmith
    May 30 8:34 AM
    • 0 Attachment
      If you're trying to jump to the last page when you add a row, the
      following should be sufficient:

      myDataTable.subscribe('addRowEvent',function () {
      this.setPage(this.getTotalPages());
      }, myPaginator, true);

      YAHOO.util.Event.on('addrow','click',function () {
      var data = {};
      /* collect values for new row */
      myDataTable.addRow(data);
      });

      Hope this helps,
      Luke

      --- In ydn-javascript@yahoogroups.com, "rashmeep2000" <RPrasad2@...>
      wrote:
      >
      > hi all,
      > my addRow method looks like this...
      > YAHOO.util.Event.addListener("addrow","click",function() {
      > //var data=.....
      > totalRecordsMy = myPaginator.getTotalRecords()
      >
      > var toAdd = myPaginator.getTotalRecords()+1;
      >
      > totalRecordsMy = totalRecordsMy+1;//alert(totalRecordsMy);
      > myPaginator.setTotalRecords(totalRecordsMy, false);
      >
      > var toPage = totalRecordsMy/rowsPerPageMy;alert("toPage--"+toPage);
      >
      > myDataTable.addRow(recoor);
      > if(toPage > myPaginator.getTotalPages()){
      > myPaginator.setPage(myPaginator.getTotalPages()+1, false);
      > }else { myPaginator.setPage(myPaginator.getTotalPages(), false);
      > }
      >
      > },this,true);
      >
      > When i cleick on addor for first time, it doesnot add row, but goes
      > to next page, on second click it adds row, also i ahve 5 rowsperpage,
      > after adding 5 rows, i keep clicking on addrow, it adds rows, but
      > doesnot paginate to the page in which it has added new row, i forced
      > my setting page, that is also not working.please help..thanks.
      >
    • Show all 13 messages in this topic