Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Tokyo
    Posts
    18
    Vote Rating
    0
    douglerner is on a distinguished road

      0  

    Default The content of tab panels - easy to define in separate script files?

    The content of tab panels - easy to define in separate script files?


    In the introduction at http://docs.sencha.com/touch/2-0/#!/...etting_started it explains how to create different "items" for different tabs.

    The content for each tab is defined in that one script file though. That's nice for simple static examples, but if there is dynamic data, and not all of it is needed at once (a user may not click on all the tabs) is there an easy way to not load the content for each tab in one file and instead have the tab transitions go between separate script files, each loading their own content as needed?

    Sorry for such a newbie question...

    Thanks,

    doug

  2. #2
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    529
    Vote Rating
    17
    estesbubba will become famous soon enough

      0  

    Default


    With JavaScript it really doesn't matter if your components are in 1 file or 100. A good practice would be to have each tab's component in its own JavaScript file defining an xtype.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Tokyo
    Posts
    18
    Vote Rating
    0
    douglerner is on a distinguished road

      0  

    Default


    Estesbubba,

    What would be the syntax for replacing, say, this first object in the array of tab panels with a reference to go to a different script file instead of using the literal contents defined here?

    {
    title: 'Home',
    iconCls: 'home',
    cls: 'home',
    html: [
    '<img src="images/someLogo.png" />',
    '<h1>Some text goes here on this home page</h1>'
    ].join("")
    },

    Thanks for your help,

    doug

  4. #4
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    529
    Vote Rating
    17
    estesbubba will become famous soon enough

      0  

    Default


    change your html: to xtype:

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Location
    Tokyo
    Posts
    18
    Vote Rating
    0
    douglerner is on a distinguished road

      0  

    Default


    Quote Originally Posted by estesbubba View Post
    change your html: to xtype:
    Hmm... Don't get how that would help yet. But I'm continuing to read the documentation.

    Thanks,

    doug

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Location
    Tokyo
    Posts
    18
    Vote Rating
    0
    douglerner is on a distinguished road

      0  

    Default


    Yes, I'm stuck. I've been reading and reading through the documentation, but don't see how changing the xtype accomplishes the goal here, of modularizing the contents of each tab panel into a separate source file.

    In one document, for example, the following source is given.

    Here we have both xtype and html together. So how would "changing html to xtype" help at all.

    Is there a simple explanation somewhere of what xtype is?

    All I really need to get going is to take the example used in the "Getting Started" example and instead of defining the content of all three tabs in one file I'd like to know how to define them in three separate files, each which only get loaded as needed.

    Thanks,

    doug


    Ext.create('Ext.Container',{ fullscreen:true, layout:'vbox', items:[{ xtype:'panel', html:'message list', flex:1},{ xtype:'panel', html:'message preview', flex:2}]});

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