PDA

View Full Version : Grid with combo , on change gives loading continuously



AtulDawkhare
30 Mar 2012, 6:18 AM
Hi
I have a Grid with "itscomponentcolumn" component to show combo in the Grid column

I am facing problem for the following scenarios.

When I write combo as follows.


xtype: 'itscomponentcolumn',
text : '<b>Permission</b>',
width: 250,
sortable:false,
dataIndex: 'permission',
items: function(value,record) {
return {
xtype: 'combobox',
store: [[0,'View Only'], [1,'View & Edit'], [2,'View,Edit & Delete'],[3,'No Access']],
displayField: 'display',
valueField: 'value',
forceSelection:true,
width: 200,
listeners: {
change: function(comboField, newValue, oldValue, eOpts)
{
AssignToEditedList(newValue,record.get('userId'),oldValue);
},
afterrender: function(combo) {
var rec=combo.findRecordByDisplay(record.get('permission'));
}

}
};
}


Its works fine.

But when I write



var comboStore = Ext.create('Ext.data.Store',
{
fields: ['value', 'display'],
data :
[
{"display":"View Only", "value":0},
{"display":"View & Edit", "value":1},
{"display":"View,Edit & Delete", "value":2},
{"display":"No Access", "value":3}
]
});

xtype: 'itscomponentcolumn',
text : '<b>Permission</b>',
width: 250,
sortable:false,
dataIndex: 'permission',
items: function(value,record) {
return {
xtype: 'combobox',
store: comboStore,
displayField: 'display',
valueField: 'value',
forceSelection:true,
width: 200,
listeners: {
change: function(comboField, newValue, oldValue, eOpts)
{
AssignToEditedList(newValue,record.get('userId'),oldValue);
},
afterrender: function(combo) {
var rec=combo.findRecordByDisplay(record.get('permission'));
}

}
};
}




It gives me loading .. on combo change event.
33348

Can you please suggest me what is wrong here?

mitchellsimoens
30 Mar 2012, 9:49 AM
If you are going to define your data inline or locally, you need to use queryMode : 'local' on the combo

AtulDawkhare
30 Mar 2012, 11:42 PM
ohh , simple mistake

Thanks a lot for correcting me. Its work for me.