У меня проблема с получением значения textField.
Просмотр:
У меня есть переменная Toobar, и я добавляю в tbar моей панели.
var orderListTbar = Ext.create('Ext.Toolbar',{
id : 'orderListTbar',
items : [
'',{
xtype : 'radiofield',
name : 'searchType',
value : 'order_name',
boxLabel : 'Order Name'
},'',{
xtype : 'radiofield',
name : 'searchType',
value : 'order_no',
boxLabel : 'Order No'
},'',{
xtype : 'radiofield',
name : 'searchType',
value : 'status',
boxLabel : 'Status'
},'=',{
xtype : 'textfield',
name : 'keyword',
value : 'Keyword'
},'|',{
xtype : 'datefield',
name : 'order_from',
fieldLabel : 'From ',
labelWidth : 40,
width : 150,
value : new Date()
},'~',{
xtype : 'datefield',
name : 'order_to',
fieldLabel : "To ",
labelWidth : 40,
width : 150,
value : new Date()
},'|',{
xtype : 'button',
name : 'searchBtn',
text : "Search"
}
]
});
И Вмой контроллерЯ хочу получить значение поля.
init : function(application){
this.control({
"#orderListTbar button[name=searchBtn]" : {
click : function(){
orderFrom = Ext.ComponentQuery.query('#orderListTbar [name=order_from]');
console.log(orderFrom); // it return Object as well
console.log(orderFrom.value); // BUT, it return undefined!!!! @.@
}
}
});
},
кто-нибудь знает, что я сделал не так?
и, если вы обнаружили, что что-то не так в моих кодах, сообщите мне.
Спасибо!