2010-11-08 16 views
6

Sono ancora nuovo in Sencha Touch/ExtJS e attualmente sto esplorando i demo e i campioni iniziali. Ma mi sono imbattuto in questo problema in cui quando inserisco un elenco annidato su elementi del pannello di schede non riesco più a navigare tra gli elementi dell'elenco.Sencha Touch: elenco annidato all'interno di un pannello a schede

Ecco il mio codice:

Ext.setup({ 
tabletStartupScreen: 'tablet_startup.png', 
phoneStartupScreen: 'phone_startup.png', 
icon: 'icon.png', 
glossOnIcon: false,   

onReady: function(){ 

    // store with data 
    var data = { 
     text: 'Groceries', 
     items: [{ 
      text: 'Drinks', 
      items: [{ 
       text: 'Water', 
       items: [{ 
        text: 'Sparkling', 
        leaf: true 
       },{ 
        text: 'Still', 
        leaf: true 
       }] 
      },{ 
       text: 'Coffee', 
       leaf: true 
      },{ 
       text: 'Espresso', 
       leaf: true 
      },{ 
       text: 'Redbull', 
       leaf: true 
      },{ 
       text: 'Coke', 
       leaf: true 
      },{ 
       text: 'Diet Coke', 
       leaf: true 
      }] 
     },{ 
      text: 'Fruit', 
      items: [{ 
       text: 'Bananas', 
       leaf: true 
      },{ 
       text: 'Lemon', 
       leaf: true 
      }] 
     },{ 
      text: 'Snacks', 
      items: [{ 
       text: 'Nuts', 
       leaf: true 
      },{ 
       text: 'Pretzels', 
       leaf: true 
      },{ 
       text: 'Wasabi Peas', 
       leaf: true 
      }] 
     },{ 
      text: 'Empty Category', 
      items: [] 
     }] 
    }; 
    Ext.regModel('ListItem', { 
     fields: [{name: 'text', type: 'string'}] 
    }); 
    var store = new Ext.data.TreeStore({ 
     model: 'ListItem', 
     root: data, 
     proxy: { 
      type: 'ajax', 
      reader: { 
       type: 'tree', 
       root: 'items' 
      } 
     } 
    }); 
    var nestedList = new Ext.NestedList({ 
     fullscreen: true, 
     title: 'Groceries', 
     displayField: 'text', 
     dock: 'top', 
     store: store 
    }); 

    var btnSpecTop = [ 
     { ui: 'back', text: 'Back'}, 
     { xtype: 'spacer' }, 
     { ui: 'default', text: 'Login' } 
    ] // end btnSpecTop 


    var tapHandler = function (btn, evt) { 
     alert("Button '" + btn.text + "' tapped."); 
    }   


    var dockedItems = [{ 
     xtype: 'toolbar', 
     dock: 'top', 
     title: 'Demo', 
     items: btnSpecTop, 
     defaults: { handler: tapHandler } 
     }, 
     { 
      xtype: 'tabpanel', 
      layout: 'card', 
      dock: 'top', 
      fullscreen: true, 
      items:[{ 
       title: 'test1', 
       html: '<p>test 1</p>' 
      }, 
      { 
       title: 'test2', 
       html: '<p>test 2</p>', 
       dockedItems: nestedList 
      }, 
      { 
       title: 'test3', 
       html: '<p>test 3</p>' 
      }] 
     }     
    ] 

    var appPanel = new Ext.Panel({ 
     id: 'appPanel', 
     fullscreen: true, 
     dockedItems: dockedItems    
    }); 

} // end onReady 
}); 

speranza che qualcuno potesse dare una mano. Grazie!

+0

voidnothings, quale versione di sencha touch stai usando? Ho appena provato il tuo codice e funziona bene per me (sto usando la v1.0) ... – carok

+0

Ci scusiamo per l'ultimo aggiornamento. La versione RC di sencha touch ha risolto questo bug. Grazie Carok! –

risposta

3

Questo errore è presente solo nella versione pre-RC di Sencha Touch. :)

0

non so quale versione Sencha-touch che si sta utilizzando, ma in sencha-touch-1.1.0 la navigazione è lavorando molto bene e non ci sono errori sono gettati alla console, in modo da provare di nuovo osservando la console , penso che ci sia stato un problema