1. #1
    Touch Premium Member
    Join Date
    Dec 2011
    Posts
    41
    Vote Rating
    0
    CInnovate is on a distinguished road

      0  

    Default Unanswered: Nested List question;

    Unanswered: Nested List question;


    I created one root item for the nestedlist programmatically and added one child item to it.
    The problem is that the child item is visible (must be hidden) when I see the root elements of the list.
    What could be wrong?

    The code is below.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" href="app/sencha-touch.css" type="text/css">
        <script type="text/javascript" src="app/sencha-touch-all.js"></script>
      
        <script>
                                 
    Ext.application({
        name         : "CIApp",
       
        launch: function() {
                  
     
         var data = {
            text: 'Groceries',
            items: []
                   }
     
        Ext.regModel('ListItem', {
            fields: [{name: 'text', type: 'string'}]
        });
     
        var store = new Ext.data.TreeStore({
            model: 'ListItem',
                                  defaultRootProperty: 'items',
            root: data
          
        });
                   var nestedList = new Ext.NestedList({
           // dock: 'left',
            useTitleAsBackText: true,
                title: '',
                displayField: 'text',
                width: 320,
                                                 height:400,
                store: store    
        });
     
                    var mPanel = Ext.create('Ext.Panel', {
                                                 fullscreen: true,
                                                 layout: 'card',
                items: [
                                                                nestedList
                                                 ]
                                  });
                   //----------------------------------------------------
                   var root=store.getRoot();
                   var parent = root.appendChild({
                                                                text: "Root Item1",
                                                 });
                          parent.appendChild({
                                                    text: "Child Item1",
                                                    leaf:true
                                     });
    }
    });
                   </script>     
         
    </head>
    <body></body>
    </html>
    Thank you.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,735
    Answers
    3364
    Vote Rating
    756
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you have the data upfront or loaded via the store this will work.

    Also note that Ext.regModel is deprecated

    Code:
    Ext.define('ListItem', {
        extend : 'Ext.data.Model',
    
        config : {
            fields : ['text']
        }
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar