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

inline cell editing when press ESC

Expand Messages
  • blurballus
    Hi, I ve a problem whit inline cell editing feature of the DataTable. I use inline cell editing with disableBtns:true. My problem is that when the ESC key is
    Message 1 of 5 , Nov 21, 2008
    • 0 Attachment
      Hi,

      I've a problem whit inline cell editing feature of the DataTable.
      I use inline cell editing with disableBtns:true.

      My problem is that when the ESC key is pressed the editor disappear and when a new cell is edited a request is made and the cell
      on which ESC was pressed gets updated.

      How can I prevent this behavior?

      Kind regards,
      Valentin
    • Satyam
      An amazing find. It is easy to reproduce even in the online examples: http://developer.yahoo.com/yui/examples/datatable/dt_cellediting_clean.html Click on any
      Message 2 of 5 , Nov 22, 2008
      • 0 Attachment
        An amazing find. It is easy to reproduce even in the online examples:

        http://developer.yahoo.com/yui/examples/datatable/dt_cellediting_clean.html

        Click on any cell in the column labeled City, enter anything and type
        Esc. The cell will remain unchanged. Click in any other cell, editable
        or not, in the same row or not. The discarded entry will suddenly
        appear in the cell. It is not only the UI that is affected, the value
        gets stored in the Recordset.

        Do you mind filing a bug? That will help the YUI team fix it:

        http://developer.yahoo.com/yui/articles/reportingbugs/

        Satyam




        blurballus wrote:
        > Hi,
        >
        > I've a problem whit inline cell editing feature of the DataTable.
        > I use inline cell editing with disableBtns:true.
        >
        > My problem is that when the ESC key is pressed the editor disappear and when a new cell is edited a request is made and the cell
        > on which ESC was pressed gets updated.
        >
        > How can I prevent this behavior?
        >
        > Kind regards,
        > Valentin
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - http://www.avg.com
        > Version: 8.0.175 / Virus Database: 270.9.8/1801 - Release Date: 20/11/2008 9:11
        >
        >
      • blurballus
        Hey Satyam, I ve seen that you ve created a report for this problem ( http://sourceforge.net/tracker/index.php?
        Message 3 of 5 , Nov 24, 2008
        • 0 Attachment
          Hey Satyam,

          I've seen that you've created a report for this problem (
          http://sourceforge.net/tracker/index.php?
          func=detail&aid=2329153&group_id=165715&atid=836476 ) .

          I'm copy/pasting here the quick fix for this issue. To fix this you
          have to override the onEditorBlurEvent method of datatable with
          following

          onEditorBlurEvent : function(oArgs) {
          if(oArgs.editor.isActive && oArgs.editor.disableBtns) {
          // Save on blur
          if(oArgs.editor.save) { // Backward incompatible
          oArgs.editor.save();
          }
          } else if(oArgs.editor.cancel) { // Backward incompatible
          // Cancel on blur
          oArgs.editor.cancel();
          }
          }


          Basically is the original method with isActive test added.

          Thank you.

          Kind regards,
          Valentin


          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > An amazing find. It is easy to reproduce even in the online
          examples:
          >
          >
          http://developer.yahoo.com/yui/examples/datatable/dt_cellediting_clean
          .html
          >
          > Click on any cell in the column labeled City, enter anything and
          type
          > Esc. The cell will remain unchanged. Click in any other cell,
          editable
          > or not, in the same row or not. The discarded entry will suddenly
          > appear in the cell. It is not only the UI that is affected, the
          value
          > gets stored in the Recordset.
          >
          > Do you mind filing a bug? That will help the YUI team fix it:
          >
          > http://developer.yahoo.com/yui/articles/reportingbugs/
          >
          > Satyam
          >
          >
          >
          >
          > blurballus wrote:
          > > Hi,
          > >
          > > I've a problem whit inline cell editing feature of the
          DataTable.
          > > I use inline cell editing with disableBtns:true.
          > >
          > > My problem is that when the ESC key is pressed the editor
          disappear and when a new cell is edited a request is made and the cell
          > > on which ESC was pressed gets updated.
          > >
          > > How can I prevent this behavior?
          > >
          > > Kind regards,
          > > Valentin
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > > ------------------------------------------------------------------
          ------
          > >
          > >
          > > No virus found in this incoming message.
          > > Checked by AVG - http://www.avg.com
          > > Version: 8.0.175 / Virus Database: 270.9.8/1801 - Release Date:
          20/11/2008 9:11
          > >
          > >
          >
        • Satyam
          The issue kept bugging me so when I realized what the problem might be and found a fix I went to SourceForge to append the fix to the initial report and since
          Message 4 of 5 , Nov 24, 2008
          • 0 Attachment
            The issue kept bugging me so when I realized what the problem might be
            and found a fix I went to SourceForge to append the fix to the initial
            report and since I didn't find it, I filed it myself. A lot of people
            get shy about filing the reports and the YUI team doesn't find out about
            them, it is too easy to miss an email with an important issue.

            I realize, though, that I should have also mailed the fix, sorry about
            that. Thanks for bringing it up.

            Satyam


            blurballus wrote:
            > Hey Satyam,
            >
            > I've seen that you've created a report for this problem (
            > http://sourceforge.net/tracker/index.php?
            > func=detail&aid=2329153&group_id=165715&atid=836476 ) .
            >
            > I'm copy/pasting here the quick fix for this issue. To fix this you
            > have to override the onEditorBlurEvent method of datatable with
            > following
            >
            > onEditorBlurEvent : function(oArgs) {
            > if(oArgs.editor.isActive && oArgs.editor.disableBtns) {
            > // Save on blur
            > if(oArgs.editor.save) { // Backward incompatible
            > oArgs.editor.save();
            > }
            > } else if(oArgs.editor.cancel) { // Backward incompatible
            > // Cancel on blur
            > oArgs.editor.cancel();
            > }
            > }
            >
            >
            > Basically is the original method with isActive test added.
            >
            > Thank you.
            >
            > Kind regards,
            > Valentin
            >
            >
            > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
            >
            >> An amazing find. It is easy to reproduce even in the online
            >>
            > examples:
            >
            >>
            > http://developer.yahoo.com/yui/examples/datatable/dt_cellediting_clean
            > .html
            >
            >> Click on any cell in the column labeled City, enter anything and
            >>
            > type
            >
            >> Esc. The cell will remain unchanged. Click in any other cell,
            >>
            > editable
            >
            >> or not, in the same row or not. The discarded entry will suddenly
            >> appear in the cell. It is not only the UI that is affected, the
            >>
            > value
            >
            >> gets stored in the Recordset.
            >>
            >> Do you mind filing a bug? That will help the YUI team fix it:
            >>
            >> http://developer.yahoo.com/yui/articles/reportingbugs/
            >>
            >> Satyam
            >>
            >>
            >>
            >>
            >> blurballus wrote:
            >>
            >>> Hi,
            >>>
            >>> I've a problem whit inline cell editing feature of the
            >>>
            > DataTable.
            >
            >>> I use inline cell editing with disableBtns:true.
            >>>
            >>> My problem is that when the ESC key is pressed the editor
            >>>
            > disappear and when a new cell is edited a request is made and the cell
            >
            >>> on which ESC was pressed gets updated.
            >>>
            >>> How can I prevent this behavior?
            >>>
            >>> Kind regards,
            >>> Valentin
            >>>
            >>>
            >>> ------------------------------------
            >>>
            >>> Yahoo! Groups Links
            >>>
            >>>
            >>>
            >>> ------------------------------------------------------------------
            >>>
            > ------
            >
            >>> No virus found in this incoming message.
            >>> Checked by AVG - http://www.avg.com
            >>> Version: 8.0.175 / Virus Database: 270.9.8/1801 - Release Date:
            >>>
            > 20/11/2008 9:11
            >
            >>>
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >
            >
            >
            > ------------------------------------------------------------------------
            >
            >
            > No virus found in this incoming message.
            > Checked by AVG - http://www.avg.com
            > Version: 8.0.175 / Virus Database: 270.9.9/1807 - Release Date: 23/11/2008 10:59
            >
            >
          • malafskyg
            Good fix. I found another approach after tracing all the event firings. The problem appears to be that the cell editor is not actually destroyed in the
            Message 5 of 5 , Dec 1, 2008
            • 0 Attachment
              Good fix. I found another approach after tracing all the event
              firings. The problem appears to be that the cell editor is not
              actually destroyed in the "cancel" event handler in datatable.js. The
              offending line is at 15644

              this.getDataTable._oCellEditor = null;

              This does not actually null the editor for the parent datatable. I
              added the following line after the existing line to force eliminating
              the active editor:

              this._oDataTable._oCellEditor = null;

              With this change, I do not have to add logic to the
              _onEditorBlurEvent. I initially did use isActive as a test in
              _onEditorBlurEvent but this was still a problem in that I set it up
              for double clicks to initiate the editor and these were not able to
              fire this event since a single click initiated the blur event.

              Additionally, I traced the blur event and it was firing both the save
              and cancel event handlers of the editor from yahoo-dom-event.js.


              -GPM

              --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
              >
              > The issue kept bugging me so when I realized what the problem might be
              > and found a fix I went to SourceForge to append the fix to the initial
              > report and since I didn't find it, I filed it myself. A lot of people
              > get shy about filing the reports and the YUI team doesn't find out
              about
              > them, it is too easy to miss an email with an important issue.
              >
              > I realize, though, that I should have also mailed the fix, sorry about
              > that. Thanks for bringing it up.
              >
              > Satyam
              >
              >
              > blurballus wrote:
              > > Hey Satyam,
              > >
              > > I've seen that you've created a report for this problem (
              > > http://sourceforge.net/tracker/index.php?
              > > func=detail&aid=2329153&group_id=165715&atid=836476 ) .
              > >
              > > I'm copy/pasting here the quick fix for this issue. To fix this you
              > > have to override the onEditorBlurEvent method of datatable with
              > > following
              > >
              > > onEditorBlurEvent : function(oArgs) {
              > > if(oArgs.editor.isActive && oArgs.editor.disableBtns) {
              > > // Save on blur
              > > if(oArgs.editor.save) { // Backward incompatible
              > > oArgs.editor.save();
              > > }
              > > } else if(oArgs.editor.cancel) { // Backward incompatible
              > > // Cancel on blur
              > > oArgs.editor.cancel();
              > > }
              > > }
              > >
              > >
              > > Basically is the original method with isActive test added.
              > >
              > > Thank you.
              > >
              > > Kind regards,
              > > Valentin
              > >
              > >
              > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
              > >
              > >> An amazing find. It is easy to reproduce even in the online
              > >>
              > > examples:
              > >
              > >>
              > > http://developer.yahoo.com/yui/examples/datatable/dt_cellediting_clean
              > > .html
              > >
              > >> Click on any cell in the column labeled City, enter anything and
              > >>
              > > type
              > >
              > >> Esc. The cell will remain unchanged. Click in any other cell,
              > >>
              > > editable
              > >
              > >> or not, in the same row or not. The discarded entry will suddenly
              > >> appear in the cell. It is not only the UI that is affected, the
              > >>
              > > value
              > >
              > >> gets stored in the Recordset.
              > >>
              > >> Do you mind filing a bug? That will help the YUI team fix it:
              > >>
              > >> http://developer.yahoo.com/yui/articles/reportingbugs/
              > >>
              > >> Satyam
              > >>
              > >>
              > >>
              > >>
              > >> blurballus wrote:
              > >>
              > >>> Hi,
              > >>>
              > >>> I've a problem whit inline cell editing feature of the
              > >>>
              > > DataTable.
              > >
              > >>> I use inline cell editing with disableBtns:true.
              > >>>
              > >>> My problem is that when the ESC key is pressed the editor
              > >>>
              > > disappear and when a new cell is edited a request is made and the
              cell
              > >
              > >>> on which ESC was pressed gets updated.
              > >>>
              > >>> How can I prevent this behavior?
              > >>>
              > >>> Kind regards,
              > >>> Valentin
              > >>>
              > >>>
              > >>> ------------------------------------
              > >>>
              > >>> Yahoo! Groups Links
              > >>>
              > >>>
              > >>>
              > >>> ------------------------------------------------------------------
              > >>>
              > > ------
              > >
              > >>> No virus found in this incoming message.
              > >>> Checked by AVG - http://www.avg.com
              > >>> Version: 8.0.175 / Virus Database: 270.9.8/1801 - Release Date:
              > >>>
              > > 20/11/2008 9:11
              > >
              > >>>
              > >
              > >
              > > ------------------------------------
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              > >
              ------------------------------------------------------------------------
              > >
              > >
              > > No virus found in this incoming message.
              > > Checked by AVG - http://www.avg.com
              > > Version: 8.0.175 / Virus Database: 270.9.9/1807 - Release Date:
              23/11/2008 10:59
              > >
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.