Results 1 to 3 of 3

Thread: Migration 4.0.7->4.1 causing "comp.getItemId is not a function"

  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    7
    Answers
    2
    Vote Rating
    2
      1  

    Default Answered: Migration 4.0.7->4.1 causing "comp.getItemId is not a function"

    Hi, today I have tryed to migrate from extjs 4.0.7 to 4.1.

    It results that my app doesn't work anymore.

    Here is my code :

    Code:
    Ext.define("Main.component.graph.mcqsearch.Button", {
       extend:'Ext.button.Button',
       requires:'Ext.dd.DragZone',
       scale:'large',
       action:'',
       cls:'button-draggable',
       width:170,
       constrain:true,
        listeners:{
            render:
                function(v){
                    v.dragZone = Ext.create('Ext.dd.DragZone', v.getEl(), {
                        getDragData: function(e) {
                            var sourceEl = e.getTarget('.button-draggable'), d;
                            if (sourceEl) {
                                d = sourceEl.cloneNode(true);
                                
                                d.id = Ext.id();
                                d.style.top = 0;
                                return v.dragData = {
                                    sourceEl: sourceEl,
                                    repairXY: Ext.fly(sourceEl).getXY(),
                                    ddel: d,
                                    name : v.text,
                                    image : v.icon,
                                    type : 'menu'
                                };
                            }
                        },
                        getRepairXY: function() {
                            return this.dragData.repairXY;
                        }
                    });
                
            }
        }       
    }); 
    Ext.define("Main.component.graph.mcqsearch.McqMenuDragZone", {
        extend: "Ext.panel.Panel",
        requires:['Main.component.graph.mcqsearch.Button','Ext.menu.Menu'],
        layout: {
            type: 'fit',
            pack: 'start',
            align: 'stretch'
        },
        defaults: {border: false},
        initComponent: function(){
            var menuItems = [ Ext.create('Main.component.graph.mcqsearch.Button',{icon:'stuff/resources/images/menu1.png',text:'Menu1'}),
                              Ext.create('Main.component.graph.mcqsearch.Button',{icon:'stuff/resources/images/menu2.png',text:'Menu2'}),
                              Ext.create('Main.component.graph.mcqsearch.Button',{icon:'stuff/resources/images/menu3.png',text:'Menu3'})];
    
    
            this.items = [{
                xtype: "menu",
                autoScroll:true,
                floating: false,  
                border: false,
                items: [menuItems]
            }];
            this.callParent();
        }
    });
    FireBug gives me this error : comp.getItemId is not a function

    return comp.getItemId();

    And Chrome this one :
    Uncaught TypeError: Object [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] has no method 'getItemId'

    It appears that it blocks at "this.callParent()";

    Could someone help me, please ?

  2. So, I found the solution.

    items:[menuItems]

    has to be replace by

    items:menuItems

    I still have some problems with the dragData, but I should find.

  3. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    7
    Answers
    2
    Vote Rating
    2
      1  

    Default

    So, I found the solution.

    items:[menuItems]

    has to be replace by

    items:menuItems

    I still have some problems with the dragData, but I should find.

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Metz, France
    Posts
    60
    Vote Rating
    2
      0  

    Default

    Hello!

    I have same problem with grid drag and drop. I can't do model.getParamId() on the drop model... Have you find a solution ?

Posting Permissions

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