PDA

View Full Version : Multiselect - 'Selected' doesn't display if 'Available' store is reloaded



benmclendon
15 Dec 2010, 8:47 AM
In this example... I load the 'storeTherapy' store immediately after onReady. Then on double clicking the row, my 'on.grid' reloads the datastore if needed based on a column value when displaying the window/form. If the store reloads with different values than those in the default load statement, the 'Selected' is empty.

Canceling out of the form and then double clicking the same row a second time causes the form to render properly. Makes me think it is the sequence inside of the on.grid OR the form field is rendering before the store is done reloading?

Any help is greatly appreciated!!

Version = Ext.3.3.1

This is the grid.on:

grid.on('rowdblclick', function (grid, rowIndex, eventObj) {

var recordType = grid.getStore().getAt(rowIndex).get('iv_dme');
if (recordType == 'DME') {
storeTherapy.reload({params : {start : 0, limit : 999, sort : 'item_value', dir : 'ASC', filter_column: 'list', filter_value: 'DME_Equipment'}});
}
if (recordType == 'ISS') {
storeTherapy.reload({params : {start : 0, limit : 999, sort : 'item_value', dir : 'ASC', filter_column: 'list', filter_value: 'DME_Equipment'}});
}
if (recordType == 'IV') {
storeTherapy.reload({params : {start : 0, limit : 999, sort : 'item_value', dir : 'ASC', filter_column: 'list', filter_value: 'IV_Therapy'}});
}

var record = grid.getStore().getAt(rowIndex);
winAddEdit.show();
formAddEdit.form.setValues(record.data);

if (recordType == 'DME') {
formAddEdit.fsivonly.collapse();
formAddEdit.fscash.expand();
}
if (recordType == 'ISS') {
formAddEdit.fsivonly.collapse();
formAddEdit.fscash.expand();
}
if (recordType == 'IV') {
formAddEdit.fsivonly.expand();
formAddEdit.fscash.expand();
}
formAddEdit.editButton.show();
formAddEdit.addButton.hide();
if (formAddEdit.paymentmethod.value == 'Check') {
formAddEdit.checknumber.show();
} else {
formAddEdit.checknumber.hide();
}
formAddEdit.ivdme.focus('', 10);
});


This is the field set with the issue:

var fs_equipment = {
xtype: 'fieldset',
title: 'Equipment',
collapsible: true,
autoHeight: true,
collapsed: false,
items: [{
xtype: 'itemselector',
hideLabel: true,
name: 'equipment_select',
ref: '../../../equipmentSelector',
imagePath: '/ext-3.3.1/examples/ux/images/',
multiselects: [{
width: 134,
height: 200,
store: storeTherapy,
displayField: 'item_value',
valueField: 'item_value'
},{
width: 134,
height: 200,
store: storeEquipmentMulti,
displayField: 'item_value',
valueField: 'item_value'
}]
},{
xtype: 'textfield',
fieldLabel: 'Other',
name: 'equipment',
width: 183
}]
}