PDA

View Full Version : Combobox not populating after select?



ehask71
9 Dec 2009, 10:50 PM
This is a Combobox in a Form panel called from a link. The dataStore is loading properly and if I select an item and submit. The result is correct. Its just the after I select an item the combobox still shows the Empty Text



function extstatuschange(domain,status,keyexists){

var statusarr = [
['updated','updated'],
['ignore','ignore'],
['later','later'],
['changed','changed'],
['added','added']
];
if(keyexists == 'Y'){
statusarr.push(['approved','approved']);
}

var statusStore = new Ext.data.SimpleStore({
fields: ['status','label'],
data: statusarr
});
//alert(statusarr.toString());

var statusForm = null;

var statusForm = new Ext.FormPanel({
labelWidth: 100, // label settings here cascade unless overridden
frame:true,
id:'statusForm',
waitMsgTarget: true,
title: 'Update Status For ' + domain,
bodyStyle:'padding:5px 5px 0',
width: 350,
defaults: {width: 230},
defaultType: 'textfield',
modal:true,
method: 'POST',
url: 'manage_customersv3.php?action=ajax_update_status',
buttons: [
{text:'Save', handler:updateStatus},
{text:'Cancel',handler: function(){ updateStatusWin.close(); } }
],
items: [{
fieldLabel: 'Update Status',
xtype: 'combo',
name: 'status1',
hiddenName:'status1',
id: 'status1',
mode:'local',
valueField: 'status',
displayField: 'label',
triggerAction: 'all',
editable: false,
emptyText:'Select Status...',
store:statusStore
},{
fieldLabel: 'domain',
name: 'thedomain',
xtype:'hidden',
value:domain
}
]
});

var updateStatusWin = null;
var updateStatusWin = new Ext.Window({
layout:'fit',
width:400,
height:200,
closeAction:'close',
plain:true,
modal:true,
items: statusForm
});

updateStatusWin.doLayout();
updateStatusWin.show();
statusForm.render('form-ct');

function updateStatus(btn,text){
// update Splitter
statusForm.getForm().submit({
url: 'manage_customersv3.php',
method: 'POST',
waitMsg:'Saving...',
reset: false,
params:{action:'ajax_update_status'},
success: function(result, request) {
updateStatusWin.close();
var override = getQueryVariable("override");
var step = getQueryVariable("step");
window.location = 'domain_approval.php?override='+ override;
}
});
}

}


Thx for any pointers

Condor
10 Dec 2009, 12:47 AM
id and hiddenName are not allowed the have the same value!