[CLOSED] Default Drag TreeNode text

  1. #1

    [CLOSED] Default Drag TreeNode text

    Hi,

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

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

    Is there any way to change this text?

    Thanks.
    Last edited by Daniil; Jun 20, 2012 at 9:05 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please set up the TreeViewDragDrop DragText property. The default value is
    DragText="{0} selected node{1}"
  3. #3
    Thanks.

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

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

    Or else, any way to chamge this message dynamically?
  4. #4
    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.
  5. #5
    Ok,

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

    Thanks.

Similar Threads

  1. Replies: 2
    Last Post: Mar 13, 2012, 10:23 AM
  2. [CLOSED] Removing drag target from drag group.
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 04, 2011, 8:41 PM
  3. [CLOSED] FileUploadField default button text is not localized
    By anup in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 03, 2011, 10:15 PM
  4. Replies: 0
    Last Post: Dec 10, 2009, 11:14 AM
  5. treenode color text
    By robsonjose in forum 1.x Help
    Replies: 1
    Last Post: Oct 16, 2009, 12:10 PM

Posting Permissions