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

Re: wrong id paging datatable

Expand Messages
  • druidarab
    correct me if i am wrong. but my supposition on this problem is that client side paging will always return the value of the initial loaded dataset on the
    Message 1 of 4 , Sep 5, 2007
    • 0 Attachment
      correct me if i am wrong. but my supposition on this problem is that client side paging
      will always return the value of the initial loaded dataset on the screen because the dom is
      not being overwritten with new data each time you page to a new page so that the dom is
      only going to contain the initial loaded data. it seems the complex datatable example is a
      bit misleading in that it seems to represent by adding notes that you can page through the
      result set and add a note wherever which although true in the current view is not true if
      you try to write the record id to a database such as mysql. i am going to try server side
      paging instead which should give me what i am trying to do, page through results and edit
      on the page like a spreadsheet.




      --- In ydn-javascript@yahoogroups.com, "michael mccarron" <9907406@...> wrote:
      >
      > Hi,
      > I was wondering if I am making a basic mistake. but when i page
      > through my datatable and try to edit a cell it gives me the id of the
      > table as it loaded on the page not the current cell, if i am on page 3
      > and edit the 3rd row down it give me the id row 3 of the first page,
      > the initial loaded dataset not the current page 3 row 3.
      >
      > some code:
      >
      >
      > // get the id of the record being updated
      > var rec_id = index_id._oData.id
      >
      > var oOldData = oArgs.oldData;
      > var oNewData = oArgs.newData;
      >
      > if(oOldData != oNewData){
      > if(oArgs.editor.column.key == "name") {
      > params = '&name='+oNewData+'&id='+rec_id;
      > new Ajax.Updater('i', '/artists/grid_name_editor', {
      > method:'post', parameters:params} );
      > //this.saveCellEditor();
      > }
      >
      > if(oArgs.editor.column.key == "description") {
      > params = '&description='+oNewData+'&id='+rec_id;
      >
      > new Ajax.Updater('i', '/artists/grid_description_editor',
      > { method:'post', parameters:params} );
      > //this.saveCellEditor();
      > }
      >
      >
      >
      >
      > if(oArgs.editor.column.key == "genre") {
      > params = '&genre='+oNewData+'&id='+rec_id;
      >
      > new Ajax.Updater('i', '/artists/grid_genre_editor', {
      > method:'post', parameters:params} );
      > //this.saveCellEditor();
      > }
      >
      >
      >
      > if(oArgs.editor.column.key == "active") {
      >
      > if(oNewData == 'yes'){
      > active = '1';
      > } else {
      > active = '0';
      > }
      >
      > params = '&active='+active+'&id='+rec_id;
      >
      > new Ajax.Updater('i', '/artists/grid_active_editor', {
      > method:'post', parameters:params} );
      > this.saveCellEditor();
      > }
      >
      > }
      >
      >
      >
      >
      >
      > --
      > Michael McCarron
      > 330-990-7406
      >
      >
      > photo-blog: http://www.flickr.com/photos/autonomous019/
      > "We The People": http://www.unity08.org
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.