PDA

View Full Version : extjs4.0.7 change dragText



timTaylor
27 May 2012, 12:27 PM
Hi,
I've overwritten Ext.dd.DragSource to get a notification by an event on start drag:


Ext.override(Ext.dd.DragSource, {
/**
* Own Extension to get notified with an event on start dragging.
* Position listener in the viewConfig!
* ---------------------------------------------------------------------
*/
onStartDrag : function()
{
this.view.fireEvent('onStartDrag', this);
}
});

Now I get the following object by catching the event and after searching for about 2 hours I can't find any method to change the dragText.


DDMInstance: Ext.Class.newClass
_domRef: HTMLDivElement
available: true
cachedViewportSize: Object
centerFrame: undefined
config: Object
cursorIsOver: true
ddGroup: "ddGroup_user"
ddel: Ext.Element.Ext.core.Element
deltaSetXY: Array[2]
deltaX: -12
deltaY: -20
dragData: Object
dragElId: "ext-gen1182"
dragText: "dragging ..."
dragging: false
el: Ext.Element.Ext.core.Element
groups: Object
handleElId: "usermanagergrid-body"
id: "usermanagergrid-body"
initPageX: 50
initPageY: 130
invalidHandleClasses: Array[0]
invalidHandleIds: Object
invalidHandleTypes: Object
isTarget: false
lastPageX: 165
lastPageY: 310
maintainOffset: undefined
padding: Array[4]
primaryButtonOnly: true
proxy: Ext.Class.newClass
resizeFrame: false
scroll: true
startPageX: 50
startPageY: 203
view: Ext.Class.newClass
__proto__: Class.registerPreprocessor.prototype


following code has no effect:


listeners: {
onStartDrag: function (obj)
{
obj.dragText = 'my new dragtext';
// TODO dragtext render-update...??
}
}


is there any update() function anywhere or something else to change the text?

mitchellsimoens
7 Jun 2012, 12:03 PM
onStartDrag is too late, it fires after the drag text is gotten. If you look at Ext.view.DragZone in the onInitDrag methid, you will see the me.ddel.update(me.getDragText()) gets fired before onStartDrag. You could do it with me.ddel.update('some text')