2012-11-03 66 views
1

見附件煎茶觸摸2鏈接UI元素,我想「忘記密碼」是一個鏈接,而不是一個按鈕,但我不能找到在煎茶負責偵聽click事件,犯規的任何鏈接UI元素它存在嗎? enter image description here可以點擊

回答

0

您可以使用煎茶途徑,例如:

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

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

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

然後你可以使用路由名稱哈希標籤如後製定的鏈接:

http://myapp.com#forgot-password 

更多航線上的位置:http://docs.sencha.com/touch/2-0/#!/guide/history_support

+0

聰明,我喜歡這個!我實際上坐在整個週末實施歷史支持,所以將修復像你描述的那樣做 –

+1

這並不回答這個問題 – Interfector

5

您可以簡單地使用一個組件併爲其定義html,請參閱下面的代碼:

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