accessing switch in another view

2 posts, 0 answers
  1. bjadams
    bjadams avatar
    3 posts
    Member since:
    Aug 2012

    Posted 10 Aug 2012 Link to this post

    i have 2 views, the "main page" view and the "settings" view.

    the "main page" view fires up as soon as the app starts and the "settings" view fires up when the user clicks on the settings icon.

    i want to access a switch in the "settings view" from the "main view". 

    the problem is that right now unless the user clicks the "settings view" first, the switch is not initialised so it is inaccessible.

    what options do i have to make the switch on the "settings view" initialised from the very start?

  2. Ali
    Ali avatar
    16 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2012 Link to this post

    I faced a similar issue, I solved it by adding my code to access the switch in that view in a function, then using 
    <div data-role="view" id="myviewid" data-before-show="myfunction">

    To call my function before showing the view, and it works well.

Back to Top