I have a problem with getting textField value.
View :
I have Toobar variable and I add to tbar of my panel.
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"
}
]
});
And In my controller. I want to get the fields value.
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!!!! @.@
}
}
});
},
anybody know what I did wrong?
and If you have found something wrong in my codes, please advice me.
Thank you!
You should use
getValuemethod instead ofvalueproperty.valueis not listed in API.Also notice that
Ext.ComponentQuery.queryreturns array.