1
如何将我的selectfield的值正确传递到我店中的ajax代理?将视图中的selectfield中的值传递给商店
Ext.define('FirstApp.view.Home',{
extend:'Ext.Panel',
xtype:'home',
config:{
title:'Home',
iconCls:'home',
html:'<h1>Home Page</h1><hr><p>Welcome to Sencha Touch 2 Training</p>',
layout:'fit',
scrollable:true,
styleHtmlContent:true,
styleHtmlCls:'home',
items: [
{
xtype: 'selectfield',
id: 'visit',
label: 'Choose one',
value:'restaurant',
options: [
{text: 'Museum', value: 'museum'},
{text: 'Pubs', value: 'pub'},
{text: 'Attractions', value: 'attraction'}
]
}
]
}
})
我想把值放在这里:'+ REFERENCE HERE +'在下面的代码中。我曾尝试“+#访问+”和“+#+价值”,但没有成功
Ext.define('FirstApp.store.Places',{
extend:'Ext.data.Store',
config:{
autoLoad:true,
model:'FirstApp.model.Place',
proxy:{
type:'ajax',
url:'https://maps.googleapis.com/maps/api/place/search/json? location=52.247983,-7.141113&radius=10000&types=food&name='+ REFERENCE HERE +'&sensor=false&key=KEY',
reader:{
type:'json',
rootProperty:'results'
}
}
}
})
我试过'+ Ext.getCmp('visit')。getValue()+'从这里我得到下面的错误。 Uncaught TypeError:无法调用未定义的方法getValue – paulpwr 2013-03-21 11:26:31