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

Problem with DataTable's Handling of Inline Editing

Expand Messages
  • nanabite
    Hi All, I am putting together a DataTable with inline editing and am experiencing some problems after callback from my asyncSubmitter. If I click in a cell
    Message 1 of 5 , Feb 2, 2009
    View Source
    • 0 Attachment
      Hi All,

      I am putting together a DataTable with inline editing and am experiencing some problems after callback from my asyncSubmitter.

      If I click in a cell within my DataTable the TextboxCellEditor appears. When I make a change and submit the call goes to my backend without any problems and my function returns the following JSON:

      {"replyCode":200,"replyText":"New Value Here"}


      Here's where it gets confusing for me. If I have disableBtns set to "false" and I click the "Save" button to save the value, everything works fine. If however I have the disableBtns set to "true" and click away to save, the cell I click into receives the callback value and cell I just edited reverts back to its old value. If I refresh the page, it is apparent that the correct data has been saved down to the database.

      Is there anything special I need to do save a value when disableBtns is "false"?

      Here is my async submitter:

      var myAsyncSubmitter = function (callback, newValue) {
          var record = this.getRecord();
          var column = this.getColumn();
          var oldValue = this.value;
          
          if(oldValue != newValue)
          {
              YAHOO.util.Connect.asyncRequest(
                  'POST',
                  sUrl,
                  {
                      success: function(o) {
                          var r = YAHOO.lang.JSON.parse(o.responseText);
                          if (r.replyCode == 200) {
                              callback(true, r.replyText);
                          } else {
                              alert(r.replyText);
                              callback(false, oldValue);
                          }
                      },
                      failure: function(o) {
                          alert(o.statusText);
                          callback(false, oldValue);
                      },
                      scope: this
                  },
                  'ajaxObj=' + ajaxObj + '&ajaxAction=update&fieldName=' + column.key
      + '&newValue=' + escape(newValue) + '&oldValue=' + escape(oldValue) +
      '&id=' + record.getData('customer')
              );
          } else {
              callback(true, oldValue);
          }            
      };
    • Satyam
      I remember that issue being reported some time ago. Check on SourceForge or at yuilibrary.com, I m sure you will find it reported there and you will find the
      Message 2 of 5 , Feb 3, 2009
      View Source
      • 0 Attachment
        I remember that issue being reported some time ago. Check on
        SourceForge or at yuilibrary.com, I'm sure you will find it reported
        there and you will find the status of the bug. I would assume that it
        will be fixed in the upcoming 2.7, but the ticket will confirm that.

        Satyam


        nanabite wrote:
        > Hi All,
        >
        > I am putting together a DataTable with inline editing and am
        > experiencing some problems after callback from my asyncSubmitter.
        >
        > If I click in a cell within my DataTable the TextboxCellEditor
        > appears. When I make a change and submit the call goes to my backend
        > without any problems and my function returns the following JSON:
        >
        > {"replyCode":200,"replyText":"New Value Here"}
        >
        > Here's where it gets confusing for me. If I have disableBtns set to
        > "false" and I click the "Save" button to save the value, everything
        > works fine. If however I have the disableBtns set to "true" and click
        > away to save, the cell I click into receives the callback value and
        > cell I just edited reverts back to its old value. If I refresh the
        > page, it is apparent that the correct data has been saved down to the
        > database.
        >
        > Is there anything special I need to do save a value when disableBtns
        > is "false"?
        >
        > Here is my async submitter:
        >
        > var myAsyncSubmitter = function (callback, newValue) {
        > var record = this.getRecord();
        > var column = this.getColumn();
        > var oldValue = this.value;
        >
        > if(oldValue != newValue)
        > {
        > YAHOO.util.Connect.asyncRequest(
        > 'POST',
        > sUrl,
        > {
        > success: function(o) {
        > var r = YAHOO.lang.JSON.parse(o.responseText);
        > if (r.replyCode == 200) {
        > callback(true, r.replyText);
        > } else {
        > alert(r.replyText);
        > callback(false, oldValue);
        > }
        > },
        > failure: function(o) {
        > alert(o.statusText);
        > callback(false, oldValue);
        > },
        > scope: this
        > },
        > 'ajaxObj=' + ajaxObj + '&ajaxAction=update&fieldName=' +
        > column.key
        > + '&newValue=' + escape(newValue) + '&oldValue=' + escape(oldValue) +
        > '&id=' + record.getData('customer')
        > );
        > } else {
        > callback(true, oldValue);
        > }
        > };
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.0.233 / Virus Database: 270.10.16/1930 - Release Date: 02/02/09 07:51:00
        >
        >
      • nanabite
        Hi Satyam, Thanks for the quick reply, I appreciate all the work you ve done around DataTables, your web site is really helping me as I am getting started. I
        Message 3 of 5 , Feb 3, 2009
        View Source
        • 0 Attachment
          Hi Satyam,

          Thanks for the quick reply, I appreciate all the work you've done around DataTables, your web site is really helping me as I am getting started.

          I went through yuilibrary.com and couldn't seem to find the specific bug (list of all DataTable related bugs are here). Do you remember where the ticket was located? If it was lost/closed, I would like to make sure it gets re-opened.

          Thanks,
          Adam

          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > I remember that issue being reported some time ago. Check on
          > SourceForge or at yuilibrary.com, I'm sure you will find it reported
          > there and you will find the status of the bug. I would assume that it
          > will be fixed in the upcoming 2.7, but the ticket will confirm that.
          >
          > Satyam
        • Satyam
          I can t find it myself, but I m sure we talked about this a few months ago. Anyway, it will be in 2.7, I m sure, and if it isn t there, its late to do
          Message 4 of 5 , Feb 4, 2009
          View Source
          • 0 Attachment
            I can't find it myself, but I'm sure we talked about this a few months
            ago. Anyway, it will be in 2.7, I'm sure, and if it isn't there, its
            late to do anything about it right now.

            Satyam


            nanabite wrote:
            > Hi Satyam,
            >
            > Thanks for the quick reply, I appreciate all the work you've done
            > around DataTables, your web site is really helping me as I am getting
            > started.
            >
            > I went through yuilibrary.com and couldn't seem to find the specific
            > bug (list of all DataTable related bugs are here
            > <http://yuilibrary.com/projects/yui2/query?status=accepted&status=assigned&status=checkedin&status=infoneeded&status=new&status=reopened&group=type&max=150&component=DataTable&order=priority&col=id&col=summary&col=status&col=priority&col=milestone&col=version>).
            > Do you remember where the ticket was located? If it was lost/closed, I
            > would like to make sure it gets re-opened.
            >
            > Thanks,
            > Adam
            >
            > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
            > >
            > > I remember that issue being reported some time ago. Check on
            > > SourceForge or at yuilibrary.com, I'm sure you will find it reported
            > > there and you will find the status of the bug. I would assume that it
            > > will be fixed in the upcoming 2.7, but the ticket will confirm that.
            > >
            > > Satyam
            >
            > ------------------------------------------------------------------------
            >
            >
            > No virus found in this incoming message.
            > Checked by AVG - www.avg.com
            > Version: 8.0.233 / Virus Database: 270.10.17/1931 - Release Date: 02/02/09 19:21:00
            >
            >
          • nanabite
            Hi Satyam, Actually, I think I found what seems to be the same issue at http://tech.groups.yahoo.com/group/ydn-javascript/message/42381
            Message 5 of 5 , Feb 4, 2009
            View Source
            • 0 Attachment
              Hi Satyam,

              Actually, I think I found what seems to be the same issue at http://tech.groups.yahoo.com/group/ydn-javascript/message/42381 . It is not clear if the issue ever got resolved, but at least I know I'm not crazy now.

              Adam

              --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
              >
              > I can't find it myself, but I'm sure we talked about this a few months
              > ago. Anyway, it will be in 2.7, I'm sure, and if it isn't there, its
              > late to do anything about it right now.
              >
              > Satyam
            Your message has been successfully submitted and would be delivered to recipients shortly.