Ext.onReady(function() {
Ext.tip.QuickTipManager.init();
// Define the model for a State
Ext.define('State', {
extend: 'Ext.data.Model',
fields: [
{type: 'string', name: 'code'},
{type: 'string', name: 'name'}
]
});
// The data for all states
// The data store holding the states; shared by each of the ComboBox examples below
var store = new Ext.data.Store({
model: 'State'
});
// Simple ComboBox using the data store
var littletype = Ext.create('Ext.form.field.ComboBox', {
id:'dailyReport_lookups_name',
renderTo: 'littletype',
displayField: 'name',
valueField: 'code',
store: store,
width: 150,
editable:false,
name: 'dailyReport.lookups.name',
hiddenName:'dailyReport.lookups.code',
hiddenValue:'code',
typeAhead: true,
queryMode: 'local',
emptyText: '请选择',
blankText: '请选择',
listeners: {
"select": function (combo, record, index) {
document.getElementById("dailyReport.lookups.code").value=combo.value;
}
}
});
});
function onload(){
if(document.all('dailyReport.category.code').value!='请选择')
{
Ext.getCmp('dailyReport_lookups_name').store.proxy.url='getLookupsListopinion.action?code='+document.all('dailyReport.category.code').value;
Ext.getCmp('dailyReport_lookups_name').store.load();
}
}
</script>我想保存CODE,但是lookups这个对象里面传过来的就只有name,求各位大侠帮忙看看。
Ext.tip.QuickTipManager.init();
// Define the model for a State
Ext.define('State', {
extend: 'Ext.data.Model',
fields: [
{type: 'string', name: 'code'},
{type: 'string', name: 'name'}
]
});
// The data for all states
// The data store holding the states; shared by each of the ComboBox examples below
var store = new Ext.data.Store({
model: 'State'
});
// Simple ComboBox using the data store
var littletype = Ext.create('Ext.form.field.ComboBox', {
id:'dailyReport_lookups_name',
renderTo: 'littletype',
displayField: 'name',
valueField: 'code',
store: store,
width: 150,
editable:false,
name: 'dailyReport.lookups.name',
hiddenName:'dailyReport.lookups.code',
hiddenValue:'code',
typeAhead: true,
queryMode: 'local',
emptyText: '请选择',
blankText: '请选择',
listeners: {
"select": function (combo, record, index) {
document.getElementById("dailyReport.lookups.code").value=combo.value;
}
}
});
});
function onload(){
if(document.all('dailyReport.category.code').value!='请选择')
{
Ext.getCmp('dailyReport_lookups_name').store.proxy.url='getLookupsListopinion.action?code='+document.all('dailyReport.category.code').value;
Ext.getCmp('dailyReport_lookups_name').store.load();
}
}
</script>我想保存CODE,但是lookups这个对象里面传过来的就只有name,求各位大侠帮忙看看。
本人也是Ext新手,答案仅供参考,若有理解接解释错误之处,请其他朋友友好指正。