Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default [CLOSED]Selection of Association in DataView

    [CLOSED]Selection of Association in DataView


    I am getting the following error when I try to select an item in a DataView that is actually an association of the model included in the store passed to the DataView.

    Uncaught TypeError: Cannot read property 'internalId' of undefined ext-all-debug.js (line 45224)
    Uncaught TypeError: Cannot read property 'id' of undefined ext-all-debug.js:32147

    Should I be able to do this or is it intended that you would only select items from the root model passed into the DataView?

    Code:
    Ext.onReady(function() {
    
        Ext.regModel('Scheme', {
            fields: ['id', 'name'],
            hasMany: 'Category',
    	proxy: {
                type: 'ajax',
                url : 'schemes.json'
            }
        });
        
        Ext.regModel('Category', {
            fields: ['id', 'name'],
            belongsTo: 'Scheme',
        });
    
        var store = new Ext.data.Store({
    		autoLoad: true,
                    model: 'Scheme',
    		storeId: 'schemeStore',
    		listeners : {
    			load : function() {
    				console.log(arguments);
    			}
    		}
        });
       
        var tpl = new Ext.XTemplate(
    		'<tpl for=".">',
    			'<div><span class="item">{name}</span></div>',
    			'<tpl for="categories">',
    				'<div><span class="item">{name}</span></div>',
    			'</tpl>',
    		'</tpl>'
        );
    	
        var dataview = new Ext.DataView({
    		renderTo: Ext.getBody(),
    		store: store,
    		tpl: tpl,
    		itemSelector: 'span.item',
    		selectedItemCls: 'selected',
    		listeners: {
                        selectionChange: function(dataview, index, node, e) {
    				console.log(arguments);
                        }
                    }
        });
    });

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,834
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Post your data as well please.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User ykey's Avatar
    Join Date
    Mar 2010
    Location
    USA
    Posts
    245
    Vote Rating
    27
    ykey has a spectacular aura about ykey has a spectacular aura about

      0  

    Default


    The more I think about it I am pretty sure I am just trying to doing something stupid here.

    Code:
    [
        {
            id: 1,
            name: 'Scheme1',       
            categories: [
                {
    				id: 1,
    				name: 'Category1'				
                },
                {
    				id: 2,
    				name: 'Category2'	
               }
    		]
        }
    ]

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,834
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    The problem is that you're duplicating the itemSelector. So for each record, you've categories.length + 1 data view selection items. Make sense?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    Gerardo Guerrero is on a distinguished road

      0  

    Exclamation I dont understand

    I dont understand


    What was the solution for this issue? i have the same problem for a tree, this is my code:

    Code:
    { 
    text: '.',
    children: [{
        text:'C&aacute;talogos',
        icon:'images/icons/application_cascade.png',
        expanded: true,
        children:[{
            text:'Empresas',
            icon:'images/icons/overlays.png',
            id:'absolute',
            leaf:true
        },{
            text:'Proveedores',
            icon:'images/icons/group_gear.png',
            id:'accordion',
            leaf:true
        },{
            text:'Clientes',
            icon:'images/icons/group.png',
            id:'anchor',
            leaf:true
        },{
            text:'Empresas reembolso',
            icon:'images/icons/key_go.png',
            id:'border',
            leaf:true
        },{
            text:'Empleados',
            icon:'images/icons/status_online.png',
            id:'card-tabs',
            leaf:true
        },{
            text:'Asignar turnos',
            icon:'images/icons/time_go.png',
            id:'card-wizard',
            leaf:true
        },{
            text:'Puntos empleado',
            icon:'images/icons/medal_gold_1.png',
            id:'column',
            leaf:true
        },{
            text:'Metas empleado',
            icon:'images/icons/medal_bronze_2.png',
            id:'fit',
            leaf:true
        },{
            text:'Asignar producto a proveedores',
            icon:'images/icons/user_go.png',
            id:'table',
            leaf:true
        },{
            text:'Asignar proveedor a productos',
            icon:'images/icons/user_comment.png',
            id:'vbox',
            leaf:true
        },{
            text:'C&aacute;talogo de clientes',
            icon:'images/icons/user_suit.png',
            id:'hbox',
            leaf:true
        }]
    },{
        text:'Productos',
        icon:'images/icons/car.png',
        id:'productos',
        children:[{
            text:'Tipos de productos',
            icon:'images/icons/cart_put.png',
            id:'center',
            leaf:true
        }]
    },{
        text:'Configuraci&oacute;n',
        icon:'images/icons/cog.png',
        id:'config',
        children:[{
            text:'Zonas de impuestos',
            icon:'images/icons/money.png',
            id:'center',
            leaf:true
        }]
    },{
        text:'Turnos',
        icon:'images/icons/time.png',
        id:'turnos',
        children:[{
            text:'Consultar turnos',
            icon:'images/icons/time_go.png',
            id:'abs-form',
            leaf:true
        },{
            text:'Detalle de turno',
            icon:'images/icons/timeline_marker.png',
            id:'tabs-nested-layouts',
            leaf:true
        }]
    }]
    }

  6. #6
    Sencha User
    Join Date
    Jun 2009
    Posts
    2
    Vote Rating
    0
    tonnisw is on a distinguished road

      0  

    Default You have more than one node with the same id.

    You have more than one node with the same id.


    In your case you have more than one id: 'center'. (There may be others.)

  7. #7
    Sencha User
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    kibriame is on a distinguished road

      0  

    Default


    i am facing same problem, my data layout like this

    [{
    categories: [
    { id: 1, name: 'Category1' },
    { id: 2, name: 'Category2' }
    ],
    colors: [
    { id: 1, name: 'Color1' },
    { id: 2, name: 'Color2' }
    ]
    }]
    please suggest me

Similar Threads

  1. Replies: 4
    Last Post: 23 Sep 2010, 5:32 AM
  2. Grid and Dataview selection problem
    By odandi in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 11 May 2010, 11:46 AM
  3. [2.2] DataView Selection and Remove
    By hast in forum Ext 2.x: Bugs
    Replies: 3
    Last Post: 15 Jan 2009, 3:35 AM
  4. Dataview + template selection problem
    By assassin in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 9 Jun 2008, 2:09 AM

Thread Participants: 4

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