Results 1 to 5 of 5

Thread: Pass variable to app.js

  1. #1
    Sencha User ksumarine's Avatar
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
      0  

    Exclamation Answered: Pass variable to app.js

    Hi,

    I have an app that has two html pages. The first being index.html, has 5 images that gives instructions to the user about the app itself. The second html page is where all the sencha touch code is (app.js, etc). Depending on which image you tap on the first page, it passes a variable to the second and activates a corresponding tab.

    So...

    Image one > tabs.html?tabid=0 > activates the first tab
    Image two > tabs.html?tabid=1 > activates the second tab

    Etc...

    Is this possible? I would imagine I need to use setActiveTab() with the passed variable, but I can't get it to work. Any help would be very much appreciated.

    Thanks!

  2. Why don't you design the start page using Sencha Touch, too?

    But anyway, if you don't want to do that, you can use window.location.href and Ext.Object.fromQueryString to parse the options into a javascript object.

    edit: you could also use the hash url notation: page.html#page-1 and get that value via window.location.hash or just use the routes feature included in ST

  3. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    86
      0  

    Default

    I'm very confused as to why anyone would want to do this.

  4. #3
    Sencha User ksumarine's Avatar
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default

    Because the first page is going to be used as instructions with descriptions about each tab for the user. Also, it serves as a quick access point to the information they need.

    I understand that you may be confused, but is it possible?

  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    49
    Answers
    6
    Vote Rating
    0
      0  

    Default

    Why don't you design the start page using Sencha Touch, too?

    But anyway, if you don't want to do that, you can use window.location.href and Ext.Object.fromQueryString to parse the options into a javascript object.

    edit: you could also use the hash url notation: page.html#page-1 and get that value via window.location.hash or just use the routes feature included in ST

  6. #5
    Sencha User ksumarine's Avatar
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
      0  

    Default

    Excellent, Ext.Object.fromQueryString worked perfectly. Thanks!

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
  •