名前、携帯電話番号、メールアドレスなどを含むフィールドセットから値を取得しようとしています。これが私のフィールドセットコードです:
{
xtype : 'fieldset',
docked : 'top',
id: 'signuptextfield',
margin : '10 0 0 0',
width : 600,
scrollable: true,
height : 180,
items : [ {
xtype : 'textfield',
id : 'consumername',
style : 'font: Droid Sans',
label : 'Consumer Name',
labelWidth : '30%'
}, {
xtype : 'numberfield',
id : 'mobilenum',
style : 'font: Droid Sans',
label : 'Mobile',
labelWidth : '30%'
}, {
xtype : 'emailfield',
id : 'email',
label : 'Customer Email id',
labelWidth : '30%',
placeHolder : 'email@example.com'
}, {
xtype : 'textareafield',
id : 'adressfield',
style : 'font: Droid Sans',
label : 'Address',
labelWidth : '30%'
}, {
xtype : 'textfield',
id : 'areafield',
style : 'font: Droid Sans',
label : 'Area/Location',
labelWidth : '30%'
}, {
xtype : 'selectfield',
label : 'City',
labelWidth : '30%',
options : [ {
text : 'Bangalore',
value : 'first'
}, {
text : 'Delhi',
value : 'second'
}, {
text : 'Mumbai',
value : 'third'
} ]
}, {
xtype : 'numberfield',
id : 'pinfield',
style : 'font: Droid Sans',
label : 'Pincode*',
labelWidth : '30%'
}, ]
}, {
xtype : 'button',
height : 40,
id : 'submitbtn',
margin : '10 0 0 0',
ui : 'orange',
width : 220,
text : 'Submit'
}
送信ボタンをクリックして、この値を取得しようとしています。まず、次のコードを試してみました。
var consumerName = Ext.getCmp('signuptextfield').getValues();
しかし、それはエラーを与えています:
Uncaught TypeError: Object [object Object] has no method 'getValues' at file:///android_asset/www/app/controller/MyController.js:164
それから私は以下のコードで試しました:
onSubmitButtonTap : function(button, e, options) {
function storeCustomerDetails(tx)
{
var consumerName = Ext.getCmp('consumername').getValue();
var consumerMobNo = Ext.getCmp('mobilenum').getValue();
var consumerEmail = Ext.getCmp('email').getValue();
var consumerAddress = Ext.getCmp('adressfield').getValue();
var consumerArea = Ext.getCmp('areafield').getValue();
console.log("the datas are:"+consumerName);
console.log("the datas are:"+consumerMobNo);
console.log("the datas are:"+consumerEmail);
console.log("the datas are:"+consumerAddress);
console.log("the datas are:"+consumerArea);
}
しかし、私は消費者の名前と携帯電話番号しか取得できません。nullを返す他のフィールド..正確な問題がどこにあるかわかりません..
ヘルプが必要です。