1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    18
    Vote Rating
    0
    dyyyy is on a distinguished road

      0  

    Default Unanswered: using templates in sencha touch 2

    Unanswered: using templates in sencha touch 2


    hi, Im trying to use templates in sencha touch 2.
    But I don't know how to add the data, i followed the instructions of the video (www.sencha.com/learn/xtemplates-part-i/ and www.sencha.com/learn/xtemplates-part-ii/ )
    and i replaced .update() with data :
    this is my code :

    Code:
    Ext.application({
        name: 'Sencha',
        launch: function() {
            var theContents = [
                                {icon : "image1.jpg" , title : "title1"},
                                {icon : "image2.png" , title : "title2"},
                                {icon : "image3.jpg" , title : "title3"},
                                {icon : "image4.jpg" , title : "title4"},
                                {icon : "image5" , title : "title5"},
                                 ];
    
    
             var contentInfo = Ext.XTemplate.from("content-template");
    
    
             var theSlideList = {
                     layout : 'hbox',
                     scrollable: {
                         direction: 'horizontal'
                     },
                     height : '120px',
                     width : '100%',
                     tpl: contentInfo,
                    data: theContents
             };
    
    
    
    
             var bigPanel = {
                     xtype : 'nestedlist',
                     title : 'big panel',
                     iconCls: 'star',
                     displayField: 'title',
                     layout:'vbox',
                     scrollable: {
                         direction: 'vertical'
                     },
                     items : [
                             theTitle,/*an html item*/
                             theSlideList,
                            /*other items*/
                             
                     ]
             };
             
             Ext.Viewport.add({
                xtype: 'tabpanel',
                tabBarPosition: 'bottom',
                items: [
                    bigPanel,
                    otherTabItem
                    ] 
                });
        }
    });
    It's giving me the error
    Uncaught TypeError: Cannot read property 'type' of undefined

    if i remove the attribute data from 'theSlideList' everything works but the contents are not shown.
    Any idea on how i should be doing this ?
    Thank you



  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    751
    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


    You shouldn't add items to the NestedList and change it's layout. If you don't like the way NestedList operates then I would create your own version instead of hacking up NestedList.
    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.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    18
    Vote Rating
    0
    dyyyy is on a distinguished road

      0  

    Default


    what's wrong with what I've done with nestedLists? I should simply remove layout : 'vbox'<br>or use another xtype ? what i've done is use the example of "getting started", the nestedList nad replaced the data with my data.<br>I'm still in my first week of sencha touch, so any advice is greatly appreciated <br>Thanks

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    751
    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


    NestedList is a Container using card layout and it's items are Lists (except the detail card). You are trying to change the layout where it uses setActiveItem internally which then it won't work as expected.
    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.

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    18
    Vote Rating
    0
    dyyyy is on a distinguished road

      0  

    Default


    Ah ok, got the point.
    Thank you

Thread Participants: 1

Tags for this Thread

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