Results 1 to 5 of 5

Thread: TreePanel to TreeGrid Drag & Drop

  1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    Warsaw, Poland
    Posts
    58

    Question TreePanel to TreeGrid Drag & Drop

    Hello,

    I have a problem creating Tree Panel to Tree Grid Drag & Drop with these conditions:

    1. You can only move the lowest child from the left tree, no dragging "folders" (I can set DropAble and draggable if necessary).
    2. When you move an item from the left tree to the right tree grid, it's copied with all the parent nodes (is it possible? The original structure must be maintained. If you move everything, you'll have exactly the same structure on the right, just with a grid).
    3. Is it possible to not have a root visible on the right tree grid and still being able to drop an item to it?
    4. If I have an empty tree grid, just with a root visible I'm getting some strange behavior while D&D, empty items are added to the dragged element, etc.

    P.S. Don't worry about items names in both panel, they're placeholders.

    Here's my current code, it's based on Desktop example from the ExtJS site:

    Code:
    MyDesktop.Edit = Ext.extend(Ext.app.Module, {
        id:'edit',
        init : function(){
            this.launcher = {
                text: 'Edycja kosztorysu',
                iconCls:'icon-estimates',
                handler : this.createWindow,
                scope: this
            }
        },
    
        createWindow : function(desktop, dataRow){
            var win = desktop.getWindow('edit-estimates-win-' + dataRow.id);
            if(!win){
                var name = 'Temat: "' + dataRow.topic + '" Nazwa: "' + dataRow.name + '"';
    			win = desktop.createWindow({
                    id: 'edit-estimates-win-' + dataRow.id,
                    title: name,
                    width: 1000,
                    height: 480,
                    iconCls: 'icon-estimates',
                    shim: false,
                    animCollapse: false,
                    border: false,
                    constrainHeader: true,
    				layout: 'border',
                    items: [
    					new Ext.tree.TreePanel({
    						useArrows: true,
    						autoScroll: true,
    						rootVisible: false,
    						animate: true,
    						region: 'west',
    						width: 200,
    						title: 'S?owniki',
    						enableDD: true,
    						containerScroll: true,
    						dataUrl: 'js/Estimates/dictionary.json',
    						requestMethod: 'GET',
    						root: {
    							nodeType: 'async',
    							text: 'Wybierz element',
    							draggable: false,
    							id: 'src'
    						}
    					}),
    					new Ext.ux.tree.TreeGrid({
    						title: 'Oferta',
    						width: 500,
    						height: 300,
    						enableDD: true,
    						region: 'center',
    						columns:[{
    							header: 'Nazwa',
    							dataIndex: 'name',
    							width: 230
    						},{
    							header: 'Szczeg?y',
    							width: 100,
    							dataIndex: 'details'
    						},{
    							header: 'Opis',
    							width: 150,
    							dataIndex: 'desc'
    						}],
    						dataUrl: 'js/Estimates/offer.json',
    						requestMethod: 'GET'
    					})
    				]
    			});
           }
            win.show();
        }
    });
    Here's how it looks like now:



    Thanks for any tip, I'm new to ExtJS but it blew my mind already

  2. #2
    Sencha User
    Join Date
    Apr 2010
    Location
    Warsaw, Poland
    Posts
    58

    Default

    Anyone?

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Warsaw, Poland
    Posts
    58

    Default

    No suggestions, on any of my 4 questions / problems?

  4. #4

    Default

    Have you already solved your problem. Especially problem 2. I got the same problem.

  5. #5
    Sencha User
    Join Date
    Apr 2010
    Location
    Warsaw, Poland
    Posts
    58

    Default

    Unfortunately, no.

Posting Permissions

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