fire html button in sencha touch

568 Views Asked by At

i am new for sencha touch. Please c my code below

Ext.define('blackbutton.view.Login.Login', {
extend: 'Ext.Panel',
xtype: 'loginview',
id:'loginview',
requires: [    
  'Ext.field.Password',
  'blackbutton.store.Login.LoginLS'
],

config: {
    cls: 'core',
    scrollable: {direction: 'vertical', directionLock: true},
     html      : '<input type="text" name="firstname"> '+
                '<input type="button" name="btnLogin" class="css" id="btnLogin" value="someValue" onclick="return false" >'+
                '<input type="button" name="btnlogout" class="css" id="btnLogout" value="someValue" onclick="return false" >'





}




//       
//       initialize: function() {
//          ns = this;
//
//
//          this.callParent(arguments);
//      }



});

It it possible to fire btnlogin and btnlogout event by using listener? If possible , please guide me some example code. Thanks

1

There are 1 best solutions below

0
Nico Grunfeld On BEST ANSWER

Im not sure what you are trying but it doesn't look like a good practice. However, the code below works (at least on chrome)

html: '<input type="button" name="btnLogin" class="css" id="btnLogin" value="someValue" onclick="console.log(\'button click\')" >',
listeners: {
    painted: function() {
        Ext.select('#btnLogin').elements[0].click();
    }
} 

Hope it helps-