Skip to content

Instantly share code, notes, and snippets.

@tayfunoziserikan
Created May 2, 2012 13:18
Show Gist options
  • Save tayfunoziserikan/2576474 to your computer and use it in GitHub Desktop.
Save tayfunoziserikan/2576474 to your computer and use it in GitHub Desktop.
remote combobobox form load
/**
* Load for record from grid data
*
* @param {Ext.data.Model} record
*/
editPersonnel: function(record) {
var me = this,
formWin = me.application.getViewport().add(
Ext.widget('personnelManager_form', {
action: 'edit'
})
);
formWin.show();
// modify form panel
formWin.setIconCls('icon-application_form_edit');
formWin.setTitle(Kebab.I18nHelper.t('kebab.texts.editRecord') + ': ' + record.data.name);
// load form from grid record
formWin.down('form').loadRecord(record);
// Bind combo value !!!! :s argh stupid code!!!!
formWin.getEl().mask('Please wait...');
formWin.down('combo').getStore().load(
{params: {query: record.data.company_name}, callback: function() {
formWin.getEl().unmask();
}}
);
formWin.down('combo').setValue(record.data.company_id);
formWin.down('combo').setRawValue(record.data.company_display_name);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment