Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    67
    Answers
    4
    Vote Rating
    2
    Tioecomp is on a distinguished road

      0  

    Default Unanswered: Nested List loading all elements at once

    Unanswered: Nested List loading all elements at once


    Hi all,

    I'm creating an app that reads a nested xml and load it into a nested list. I could read the nested XML below:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <comunicacao>    
        <grupos>
            <grupo peso="0" descricao="Dados Gerais" id= "3" parent_id="0" leaf= "true">
                <grupos/>
                <perguntas>
                    <pergunta value="Data da Visita" peso="0" medidaPreventiva="" txTipoResposta="1" type="date" id="2015">
                        <alts/>
                    </pergunta>        
                </perguntas>
            </grupo>
            <grupo peso="1" descricao="Ordem e Limpeza" id= "4" parent_id="0" leaf= "false">
                <grupos>
                    <grupo peso="5" descricao="Ordem e Limpeza1" id= "7" parent_id="4" leaf= "false">
                        <grupos>
                            <grupo peso="5" descricao="Ordem e Limpeza2" id= "8" parent_id="7" leaf= "true">
                                <pergunta value="O" peso="5" medidaPreventiva=" posteriores." txTipoResposta="3" type="radio-button" id="2421" >
                                    <alts>
                                        <alt value="0" id="0"/>                                    
                                    </alts>
                                </pergunta>
                            </grupo>
                        </grupos>
                        <perguntas>
                            <pergunta value="O" peso="5" medidaPreventiva="posteriores." txTipoResposta="3" type="radio-button" id="2432">
                                <alts>
                                    <alt value="0" id="0"/>
                                    <alt value="1" id="1"/>                                
                                </alts>
                            </pergunta>                                    
                        </perguntas>
                    </grupo>
                    <grupo peso="5" descricao="Ordem e Limpeza 3" id= "10" parent_id="4" leaf= "true">
                        <grupos/>
                        <perguntas>
                            <pergunta value="O" peso="5" medidaPreventiva="posteriores." txTipoResposta="3" type="radio-button" id="2451">
                                <alts>
                                    <alt value="0" id="0"/>                                
                                </alts>
                            </pergunta>                                    
                        </perguntas>
                    </grupo>
                </grupos>
                <perguntas/>
            </grupo>
        </grupos>
    </comunicacao>
    I loaded this xml into a TreeStore:

    Code:
    Ext.define('SesiApp.store.Grupos', {
        extend: 'Ext.data.TreeStore',
        requires: ['SesiApp.model.Grupo', 'Ext.data.reader.Xml'],
        config: {
            model: 'SesiApp.model.Grupo',
            storeId: 'Grupos',              
            proxy: {
                type: 'ajax',            
                url: 'arq.xml',
                reader: {
                    type: 'xml',
                    rootProperty: 'comunicacao',
                    record: 'grupo'
                }
            },
            autoLoad: true
        }
    });
    When I tried to load this Store into a NestedList, all the elements were shown. Like there was no hierarchical.
    nestedlist.gif

    I'm gonna put here the Group model that it is the most important one, maybe something is missing at the associations.
    Code:
    Ext.define('SesiApp.model.Grupo', {
        extend: 'Ext.data.Model',
        config: {               
            fields: [
                {
                    name: 'descricao',
                    mapping: '@descricao',
                    type: 'auto'
                }, 
                {
                    name: 'peso',
                    mapping: '@peso',
                    type: 'auto'
                },
                {
                    name: 'id',
                    mapping: '@id',
                    type: 'auto'
                },
                {
                    name: 'leaf',
                    mapping: '@leaf',
                    type: 'bool'
                },
                {
                    name: 'parent_id',
                    mapping: '@parent_id',
                    type: 'auto'
                }
            ],      
            associations: [{
                type: 'hasMany',
                model: 'SesiApp.model.Grupo',               
                name: 'grupos',           
            }, 
            {
                type: 'hasMany',
                model: 'SesiApp.model.Pergunta',          
                name: 'perguntas',            
            },
            {
                type: 'belongsTo',
                model: 'SesiApp.model.Grupo'            
            }, 
            ]
        }
    });
    I apreciate if someone could help me, I saw lots of posts of people that couldnt read and load a nested xml.

  2. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    67
    Answers
    4
    Vote Rating
    2
    Tioecomp is on a distinguished road

      0  

    Default


    Sorry I forgot the NestedList code.
    Code:
    Ext.define('SesiApp.view.GruposList',{
    	extend: 'Ext.dataview.NestedList',
    	alias: 'widget.gruposlist',	
    	config: {
    		hidden: false,
    		store: 'Grupos',
    		itemTpl: '{descricao}',
    		displayField: 'descricao',
    		onItemDisclosure: true,		
    		items:[
    		{
    			xtype: 'toolbar',
    			docked: 'top',
    			title: 'Grupos'
    		}
    		]		
    	}
    });