1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    2
    Vote Rating
    0
    mistr_e is on a distinguished road

      0  

    Default Using Drag and Drop on a tree the beforedrop event doesn't seem to fire

    Using Drag and Drop on a tree the beforedrop event doesn't seem to fire


    I have a tree and I've added the drag and drop plugin. Those function fine in the browser but I need to send the dragged and drop changes to my DB correct? To do this I believe I should listen for the drop event then make an ajax call to my back end. I have a checkchange even that fires OK but a drop or beforedrop event seem to do nothing.

    Here is my tree's config, what am I doing wrong?

    todotree = {
    title: 'Tree Grid',
    width: 600,
    height: 400,
    viewConfig: {
    plugins: {
    ptype: 'treeviewdragdrop'
    }
    },
    store: new Ext.data.TreeStore({
    storeId: 'treestore',
    fields: [{
    name: 'actionTitle',
    type: 'string'
    }
    ],
    proxy: {
    type: 'ajax',
    url: 'index.php/todo/listtree',
    reader: 'json'
    }
    }),
    rootVisible: false,
    columns: [{
    xtype: 'treecolumn',
    text: 'Title',
    flex: 3,
    dataIndex: 'actionTitle'
    }
    ],
    listeners: {
    checkchange: function(node, checked){
    Ext.Ajax.request({
    url: 'index.php/todo/togglecheck/' + node.data.recordId + '/' + checked,
    success: function() {}
    });
    },
    drop: function(){alert("drop")},
    beforedrop: function(){alert("beforedrop")}
    }
    }
    Thanks in advance

    EDIT: I also tried this config to no avail. I don't think I understand how this is all supposed to work.

    ...
    beforedrop: function(node, data, overModel, dropPosition, dropFunction){
    alert("beforedrop");

    dropFunction = function(){
    alert('dropFunction');
    };
    }
    ...

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Posts
    2
    Vote Rating
    0
    mistr_e is on a distinguished road

      0  

    Default


    I was missing the fact that drop and beforedrop are TreeView events and I was adding then to the tree panel. I should be adding them to my viewConfig.

    Hope this helps someone else.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi