PDA

View Full Version : [CLOSED] Default Drag TreeNode text



softmachine2011
Jun 19, 2012, 1:58 PM
Hi,

In our localized application, we need to change the default "1 selected node" text when a tree node item is being dragged:

http://examples2.ext.net/#/DragDrop/Tree/Tree_to_Div/

Is there any way to change this text?

Thanks.

Daniil
Jun 19, 2012, 3:12 PM
Hi,

Please set up the TreeViewDragDrop DragText property. The default value is

DragText="{0} selected node{1}"

softmachine2011
Jun 19, 2012, 4:28 PM
Thanks.

And there is any way to get the same behavior than in 1.X version?

http://examples1.ext.net/#/DragDrop/Tree/Tree_to_Div/

Or else, any way to chamge this message dynamically?

Daniil
Jun 19, 2012, 4:57 PM
I can suggest the following solution.

Example

<ext:TreeView runat="server">
<Plugins>
<ext:TreeViewDragDrop
PluginId="dd"
runat="server"
EnableDrop="false"
DragGroup="tree2div" />
</Plugins>
<Listeners>
<Render Handler="var dragZone = this.getPlugin('dd').dragZone;
dragZone.getDragText = myGetDragText;"
Delay="1" />
</Listeners>
</ext:TreeView>

var myGetDragText = function () {
return this.dragData.records[0].get("text");
};

The default function is

getDragText: function() {
var count = this.dragData.records.length;
return Ext.String.format(this.dragText, count, count == 1 ? '' : 's');
}

I assume this might be improved in the next ExtJS releases. I mean a better possibility to customize it might appear.

softmachine2011
Jun 20, 2012, 9:32 AM
Ok,

We will use this suggestion at the moment, and we will hope to get a better customization solution soon.

Thanks.