1. #1
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    San Diego, CA
    Posts
    158
    Vote Rating
    0
    locutusUT is on a distinguished road

      0  

    Question Binding routes to user actions in the Controller

    I read the docs on using routes for deep linking, but it isn't clear to me how I could bind a route to a user action in my controller. Suppose I have a List and on itemTap I would like to not only execute the code in my itemTap event but also bind a route to the include the item id to the route (e.g., /#/user/id). Is this possible?

    Here is my controller:

    Code:
            control: {
                peoplePanel: {
                    disclose: "onDisclose",
                    itemtap: "onPeopleSelected",
                    peopleSearch: "onPeopleSearch",
                    reset: "onReset",
                    favSearch: "onFavoriteSearch"
                },
    Basically, I just want to add routes to certain events I would want deep linking (disclose, itemtap, reset).

    Thanks!

  2. #2
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    San Diego, CA
    Posts
    158
    Vote Rating
    0
    locutusUT is on a distinguished road

      0  

    Default

    Basically, it looks like all you need to do is the following in your action's method call:

    Code:
    My.app.getApplication().getHistory().add(Ext.create('Ext.app.Action', {url: 'user/' + id}));