Thomas Vervik
Thomas Vervik

Reputation: 4555

Sencha Touch 2 link UI element which can be clicked

See attachment, I want the "Forgot password" to be a link instead of a button, but I cant find any Link UI element in Sencha which listen for the click event, doesnt it exist?enter image description here

Upvotes: 1

Views: 1750

Answers (2)

anurag
anurag

Reputation: 51

You can simply use a component and define the html for it, please see the code below:

{
 xtype: 'component',
 html: '<a href='+'"http://abc.com"'+ '>Forgot your password?</a>',
}

Upvotes: 5

tpolyak
tpolyak

Reputation: 1239

You can use Sencha routes, e.g.:

Ext.define('MyApp.controller.User', {
    extend: 'Ext.app.Controller',

    config: {
        routes: {
            'forgot-password': 'forgotPassword'
        }
    },

    forgotPassword: function() {
        // Your code here
    }
});

Then you can formulate the link using the route name after a hashtag e.g.:

 http://myapp.com#forgot-password

More on routes here: http://docs.sencha.com/touch/2-0/#!/guide/history_support

Upvotes: 0

Related Questions