Results 1 to 5 of 5

Thread: TextField/TextArea becomes uneditable if it is drag source

  1. #1

    Default TextField/TextArea becomes uneditable if it is drag source

    See the sample: http://www.extjs.com/deploy/dev/exam...o-grid-dd.html.
    I can not put cursor in the text fields and date field. Anyone knows how to solve the problem?

    Thanks.

  2. #2
    Ext JS Premium Member
    Join Date
    Dec 2009
    Posts
    58

    Thumbs up SOLVED

    Hi Jeff,

    you can add this simple event handler to class Ext.ux.PanelFieldDragZone:

    Code:
    onMouseUp: function(e) {
    		this.dragData.field.focus();
    	},
    It could be onMouseDown depending on how you want the field to be focused.

    Cheers,

    Totti
    me.constructor === Frontend.Engineer

  3. #3

    Default

    It works!

    Thanks tot2ivn.

  4. #4
    Sencha Premium User
    Join Date
    Jan 2008
    Location
    Germany
    Posts
    538

    Default

    @ tot2ivn

    Perfect, adding that kind of mouseup handler to a drag zone worked for me, too (http://www.extjs.com/forum/showthread.php?t=91649).

    Note that you can't use onMouseDown instead, because focussing the field would interfere with the original mousedown event data. They are stored in the Ext.EventObject singleton and required by the dragging implementation to work properly.
    If you focus the field onMouseUp however, all drag and drop processing is over already, no data getting spoiled.

    Thanks,
    Stefan

  5. #5
    Ext JS Premium Member
    Join Date
    Dec 2009
    Posts
    58

    Thumbs up

    Quote Originally Posted by Stefan B View Post
    @ tot2ivn

    Perfect, adding that kind of mouseup handler to a drag zone worked for me, too (http://www.extjs.com/forum/showthread.php?t=91649).

    Note that you can't use onMouseDown instead, because focussing the field would interfere with the original mousedown event data. They are stored in the Ext.EventObject singleton and required by the dragging implementation to work properly.
    If you focus the field onMouseUp however, all drag and drop processing is over already, no data getting spoiled.

    Thanks,
    Stefan
    Thanks for your note Steve

    Totti
    me.constructor === Frontend.Engineer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •