1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    40
    Vote Rating
    0
    jwbworks is on a distinguished road

      0  

    Default Answered: how to do history and routes with carousel and tabPanels

    Answered: how to do history and routes with carousel and tabPanels


    Hello, I want to set up history and routes in my app, but I saw it mentioned its not supported on tabs and carousel. The way my app is structured is once you are logged in I have a carousel

    in side the carousel is a container for the first view, then three tabPanel based pages for the next three. Each tab panel contains 2 or more containers. The issue I am trying to resolve is on any page I have three list views you can go to to see further documentation. The problem I am trying to fix is when you go to the list view, or eventually return to the carousel you always come back to the initial configuration where 0 is the active item.

    what I want to happen is when you return from one of the list view be on the last known active item in the carousel, and if that active item is a tabPanel know its activeItem as well.

    any thought and if possible pointers to a tutorial?

  2. Where did you see that tabpanels and carousels aren't support for history? History and views are separate, there is no view that supports history and history doesn't support any view. History is used within a controller with routes and when a route is executed it executes the method in the controller and in that you do the actions you need manually. Therefore in the route handler you do the tab switching or make whichever item in the carousel active.

  3. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    40
    Vote Rating
    0
    jwbworks is on a distinguished road

      0  

    Default


    sorry just pushing this back up to see if I can get some guidance.

    J

  4. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,642
    Vote Rating
    899
    Answers
    3574
    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


    Where did you see that tabpanels and carousels aren't support for history? History and views are separate, there is no view that supports history and history doesn't support any view. History is used within a controller with routes and when a route is executed it executes the method in the controller and in that you do the actions you need manually. Therefore in the route handler you do the tab switching or make whichever item in the carousel active.
    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. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    40
    Vote Rating
    0
    jwbworks is on a distinguished road

      0  

    Default


    thanks for the clarification Mitchell!!

    J

  6. #5
    Sencha User
    Join Date
    Apr 2013
    Posts
    5
    Vote Rating
    1
    tapancse143 is on a distinguished road

      0  

    Default sencha touch routing

    sencha touch routing


    Hi All. Today I am going to describe the routing mechanism and History management in Sencha Touch 2.0

    config: {
    routes: {
    'createProject':'createProject',
    'profile': 'populateUserInfo',
    'ProjectList/:id': 'showProject',
    'ProjectPunchList/:id':'populateProjectPunchList',
    'Task/:id':'showTaskDetails'
    }
    },

    Define your routes in your config within controller.
    Here 'createProject':'createProject' , indicates that if “#createProject” is encountered in URL then
    createProject( ) is called which is inside the same controller. Then within this function you can call the API and do other things.


    Then init the History as a variable inside your controller init function( ). Here the code goes ..
    init: function (obj) {
    var history = Ipunch.app.getApplication().getHistory()["_actions"];
    },
    With this history you can go forward and backward by URL.

    Suppose your Application has URL like “ http://localhost/index.html” . Then the point is how to redirect it to the http://localhost/index.html#createProject . So to append the #createProject in the URL you need to Redirect to the URL from any where. Suppose I am taping on a button “Create Project” and want to be redirected to the above modified URL. Then I have to write a tap event function and code goes here.

    tap: function() { Ipunch.app.getController('AdminHomeCntlr').redirectTo("createProject");
    }
    So the overall mechanism is like this . First it goes to http://localhost/index.html#createProject. Then it search to which function or action this routes is refering to . Then goes to that function and executes the code.Simple !!

    Hope you enjoyed Sencha Touch Routing...
    For more information please refer sencha touch document controller and routes section.

    Thanks
    Tapan kumar pati
    Mindfire Solutions (www. mindfiresolutions.com)