Results 1 to 3 of 3

Thread: tree.Panel drag'n'drop: on-fly dropped item modification

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    11
    Answers
    1

    Default tree.Panel drag'n'drop: on-fly dropped item modification

    Hello world!


    I have two tree.Panel with different stores and one item I want to drop from one to another. Actually, in the first tree I have a component list - user choose one element, drag it to another tree and drop there. After it a window is opened with component options. So, I want user to fill the form. After it I'll take form's values and modify dropped item. But when this item is inserted in the second tree, there's no some fields I set in beforedrop event handler. Please tell me where am I wrong?


    Code:
        task_list_beforedrop: function(node, data, overModel, dropPosition, dropHandler, eOpts) {
        var win = Ext.create('Ext.window.Window',{
            modal:true,
            title: 'Add task',
            items:[{
            xtype: 'taskForm',
            }],
        });
        win.myExtraParams = { me: overModel, data: data, dropHandler: dropHandler };
        win.on ('close', 
            function(win) { 
            if(!win.myExtraParams.success){ dropHandler.cancelDrop(); return; } 
            me = win.myExtraParams.me;
            dropHandler = win.myExtraParams.dropHandler;
            data = win.myExtraParams.data;
            var form = win.child('panel').getForm();
            var vars = form.getValues();
                    var nodeCopy = data.record[0].copy();
            nodeCopy.set( 'text', vars['text'] );
            nodeCopy.set( 'leaf', false );
            nodeCopy.set( 'worker_obj', { 'name': form.findField('worker').findRecordByValue(vars['worker']).get('name') } );
            nodeCopy.set( 'object_obj', { 'name': form.findField('object').findRecordByValue(vars['object']).get('name') } );
            nodeCopy.set( 'iconCls', node.records[0].iconCls );
                nodeCopy.set( 'parentId', me.get('id') );
            nodeCopy.set( 'worker', vars['worker'] );
            nodeCopy.set( 'object', vars['object'] );
            data.records[0] = nodeCopy;
                dropHandler.processDrop();
                return true;
            } );
            
        win.show();
            dropHandler.wait=true;
    
    
            return false;
        },

  2. #2
    Sencha - Support Team
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    11
    Answers
    1

    Default

    Hi Scott,

    No, these examples doesn't help me. They are simple and doesn't include dropped item modification in beforedrop handler. Can I modify an item in beforedrop? Is it possible?

    Best regards, Roman

Tags for this Thread

Posting Permissions

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