Reputation: 2328
try create form login in Sencha Touch 2.1
...
xtype: 'fieldset',
title: 'My Login',
items: [
{
xtype: 'emailfield',
placeHolder: 'Username',
itemId: 'userNameTextField',
name: 'userNameTextField',
required: true
},
{
xtype: 'passwordfield',
placeHolder: 'Password',
itemId: 'passwordTextField',
name: 'passwordTextField',
required: true
}
]
...
but in Chrome console
<input id="ext-element-14" class="x-input-el x-form-field x-input-email" type="email" autocapitalize="off" placeholder="Username" name="userNameTextField">
why ItemId is not working?
Upvotes: 0
Views: 3783
Reputation: 319
You can call itemid in Sencha Touch by using : "#itemID"
var field = frmLogin.query("#userNameTextField")[0];
Hope can help you have same problem.!
Upvotes: 0
Reputation: 5021
As per
Ext.ComponentQuery can only resolve a component using itemId if a parent component is referenced in the query so you are better off using id
because I don't think you application would have many login panels and you can easily access these fields like:
var pwd = Ext.getCmp('passwordTextField');
Upvotes: 1