1. #1
    Sencha User
    Join Date
    Mar 2008
    Location
    Marietta, GA
    Posts
    93
    Vote Rating
    0
    jasondeegan is on a distinguished road

      0  

    Default DropTarget on MixedCollection Item

    DropTarget on MixedCollection Item


    Ladies & Gents,

    Thanks in advance for your help. I'd like to drop a grid row (single shown column) on to one of 9 different mixedCollection items within a panel. I'm struggling with understanding what I'm doing wrong and despite searching I can't find a solution that fits my problem. Here's the code:

    Code:
    	var cardsColumns = [{
    		header: "cardId", dataIndex: 'cardId', hidden:true }, { 
    		header: "Card Vendor", sortable: false, dataIndex: 'cardVendor', hidden:true }, {
    		header: "Card Image", sortable: false, dataIndex:'cardImage', renderer:renderCard
    	}];
    	var cardsGrid = new Ext.grid.GridPanel({
    		title: 'Cards', id:'cardsGrid', store: cardsStore, columns:cardsColumns, region:'west', width:150, disableSelection:false, trackMouseOver:true, hideHeaders:false, enableHdMenu:true,
    		enableDrag:true
    	});
    
    	var cardsView = new Ext.Panel({
    		region:'center',
    		layout:{
    			type:'table',
    			columns:3
    		},
    		defaults:{
    			height:50, width:50
    		},
    		items : [{
    			id : 'panel1', 
    			html : 'Panel 1'
    		}, {
    			id : 'panel2',
    			html : 'Panel 2'
    		}, {
    			id : 'panel3',
    			html : 'Panel 3'
    		}, {
    			id : 'panel4',
    			html : 'Panel 4'
    		}, {
    			id : 'panel5',
    			html : 'Panel 5'
    		}]
    	});
    	
    	cardsView.on( "render",	function(){
    		console.log( 'rendered' );
    		var dt1 = new Ext.dd.DropTarget( Ext.get( 'panel1' ), {  /* I've also tried "Ext.getCmp" AND 'panel1' */
    			notifyDrop : function(dd, e, node, a) {
    				console.log(d, e, node, a);
    			}
    		});
    	});
    On rendering the window (which these panels fit into), I get my console.log( 'render' ), but then I get a "this.el is null" error. I'm pretty sure it's referencing the red "Ext.get( 'panel1' )" code above, but for the life of me I can't figure out if it's a premature execution or other?

    Jason
    Don't measure excellence against others, but rather against the best implementation of yourself.

  2. #2
    Sencha User
    Join Date
    Mar 2008
    Location
    Marietta, GA
    Posts
    93
    Vote Rating
    0
    jasondeegan is on a distinguished road

      0  

    Default A little progress

    A little progress


    I updated the onRender function to this and got a different error:

    Code:
    cardsView.on( "render",	function( panel ){
    	var dt1 = new Ext.dd.DropTarget( panel.items.items[0].body, {
    		notifyDrop : function(dd, e, node, a) {
    			console.log(d, e, node, a);
    		}
    	});
    });
    It doesn't render because the MixedCollection item isn't a panel with a body...hmmmm, and now I've reached my limit in understanding of how the MixedCollection Item differs from the panel and how to fix.
    Don't measure excellence against others, but rather against the best implementation of yourself.

Tags for this Thread