Results 1 to 3 of 3

Thread: ISSUE WHILE MIGRATING FROM SENCHA TOUCH 1.0 to 2.1

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Location
    Bangalore
    Posts
    3
    Vote Rating
    0
      0  

    Default ISSUE WHILE MIGRATING FROM SENCHA TOUCH 1.0 to 2.1

    I am trying to migrate from Sencha Touch 1.0 to Sencha Touch 2.1.
    Please help as to how to implement the following in Sencha touch 2.1

    I have posted part of my code , as i cannot copy my entire code here.

    MY CODE:
    tabGlobal=this;

    tabGlobal.tabItem1 = eval("("+"din.view.View2"+")");
    tabGlobal.tabItem2 = eval("("+"din.view.View1"+")");


    This is my function to add a Tab.

    addTab: function() {

    this.tabPanel = Ext.create('Ext.TabPanel', {
    fullscreen: this.fullscreen,
    cardswitchanimation: this.cardswitchanimation,
    ui: this.ui,
    flex: this.flex,
    cls: this.cls,
    plain: this.plain,
    tabBar: this.tabBar,
    items: [this.tabItem1,this.tabItem2],
    listeners: this.listeners
    });

    I get an error saying :

    Uncaught Error: [ERROR][Ext.Container#factoryItem] Invalid config, must be a valid config object.
    Error at the line items: [this.tabItem1,this.tabItem2],

    It worked in Sencha Touch 1.0 , do I need to make any changes in 2.1 to resolve the error ?

  2. #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

    What does this.tabItem1,this.tabItem2 look like?
    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

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Location
    Bangalore
    Posts
    3
    Vote Rating
    0
      0  

    Default

    this.tabItem1 and this.tabItem2 have the eval expressions of two views: din.view.view1 and din.view.view2.
    Those two views are extending panels respectively.

    While doing the eval of a view, a function is returned. This function is added as items to the tab panel. In sencha touch 1.1, these items were getting pushed as 'this.items.push(eval("("+"din.view.View1"+")"))'.

    Then a doLayout() was done on the tabPanel.
    But in sencha touch 2, 'items.push' method gives error as the method doesnt exist. So we are giving items directly as tabItem1 and tabItem2.
    Please suggest any alternatives/solutions for the same

Tags for this Thread

Posting Permissions

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