Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: nestedlist

  1. #1
    Sencha User yeimy's Avatar
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default Answered: nestedlist

    Hola:
    como puedo enlazar a cada nodo de una lista anidada y nueva vista (.js) . Este es el cdigo que tengo

    Code:
    Ext.define('Mtp.store.Demos', {
    	 	 extend: 'Ext.data.TreeStore',
            requires: ['Mtp.model.Demo', 'Mtp.view.Agilidad'],
    		config: {
                model: 'Mtp.model.Demo',
    			defaultRootProperty: 'items' ,
    			root:{
    			items: [
                	{
                   		text: 'Agilidad',
    				items: [
                        {
                            text: 'Agilidad505',
    			view: 'Agilidad',// Lo he intentado as , pero no sale
    						
    					},
                        {
    						text: 'Agilidad Illinois',
    						id: 'agilidadillinois',
    					},
    					{
    						text: 'Cambio de direccin lateral',
                            id: 'direclateral'
    						
    					},
    					{
    						text: 'Prueba rapida de pies',
                            id: 'rapidadepies'
    						
    					},
    					{
    						text: 'Zig-Zag',
                            id: 'zigzag'
               			}]
                }],
            }
      }
    });
    Gracias por su ayuda.

  2. So you want when you tap on Agilidad505 to display a view based on the view data?

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    So you want when you tap on Agilidad505 to display a view based on the view data?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User yeimy's Avatar
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default view (.js) not data view

    I wish that when you click on Agillidad505 show a view .js a calculator is not a Data View

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    If it is a leaf it will go to the detailCard you can specify in the detailCard config of the nestedlist. You can use leafitemtap event on the nestedlist to apply data to the detailCard.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #5
    Sencha User yeimy's Avatar
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default

    I triedlike this:

    Ext.define('Mtp.view.Calculadora', {extend: 'Ext.NavigationView',
    //requires: ['Mtp.view.Agilidad505'],
    xtype: 'calculadora',



    config:
    {

    title: 'Calculadoras',
    iconCls: 'bookmarks',
    //autoDestroy: false,

    items:[{
    xtype:'nestedlist',
    //itemTpl: '{title}',
    title:'Caculadoras',
    store:'Demos',
    detailCard: {
    xtype:'panel',
    scrollable: true,
    styleHtmlContent: true,

    },
    listeners: {
    leafitemtap: function(nestedList, list, index, element, post, view) {
    this.getDetailCard().setHtml(post.get('view'));
    }
    }

    }]
    }

    });



    but I write takes its name from the view (examle if the view is view: 'Agilidad505' from the end of the road I get only "Agilidad505") and does not lead me to the view that name is (Mtp. view.Agilidad505), saved as Agilidad505.js

  7. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    You can use add() to add a component to the detail card based on selection or setDetailCard to replace the detail card within the leafitemtap event listener.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  8. #7
    Sencha User yeimy's Avatar
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default

    I did like this:

    Code:
    Ext.define('Mtp.view.Calculadora', {extend: 'Ext.NavigationView',
    xtype: 'calculadora',
        config: 
        {
            tab: {
            title: 'Calculadoras',
            iconCls: 'bookmarks',
            scrollable: true,
            //text:'Calculadoras'
            },
            
                   
                items:[{
                    title:'Categorias',
                    xtype:'nestedlist',                
                    store:'Demos',
                    
                
        
        listeners: {
            leafitemtap: function(nestedList, list, index, element, post, view) {
                
                var me = list.getParent(),
                store = list.getStore(),
                record  = store.getAt(index);
                byXtype = record.get('xtype');
                title: record.get('title');
                var name = record.get('view'),
                    ns   = 'Mtp.view.';
                // BUILD THE VIEW
                 view = Ext.create(ns + name, { 
                    title: record.get('text'),                                
                 });
                console.log(ns + name); 
                // ATTACH THE VIEW AS A PANEL to the Tabbed View
                var calculadorPanel = Ext.getCmp(byXtype) || view
                                calculadorPanel.setRecord(list.getStore().getAt(index));
                                if (!calculadorPanel.getParent()) {
                                    // Go to the newly created panel with our custom view
                                    this.parent.setActiveItem(calculadorPanel, 'slide');//Ext.NavigationView.add(editorPanel);                    
                                }
                                calculadorPanel.show();
                }
            }
                    }]
            
            
        },
        getViewName: function(item) {
            var name = item.get('name') || item.get('text'),
                ns   = 'Mtp.view.';
                return ns + name;        
        },
    });


    Now I want the title of the nestedlist not repeat, I have this:
    pantallaapp.jpg

    I want a different top or the bottom


  9. #8
    Sencha User yeimy's Avatar
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default

    please help!!!!!!!!!!!!!!!!!!!!

  10. #9
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    One is for the navigation view and the other is for the nestedlist. If you don't want the one for nestedlist then use the toolbar config
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  11. #10
    Sencha User yeimy's Avatar
    Join Date
    Apr 2012
    Posts
    12
    Vote Rating
    0
      0  

    Default

    I could not do it, I want the title"Calculadoras" in the navigation view and the title "Categorias" in the nestedlist

Page 1 of 2 12 LastLast

Posting Permissions

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