PDA

View Full Version : Problem while rendering the combo box into the dynamic editable grid



biswajit.rout
4 Dec 2012, 12:58 AM
Hello,
In my dynamic editable grid, the status column is referring another table. Since it is referring another table I have populated combo box as an editor for the status column. My combo box is also getting populated with data in a value-display pair. But in my grid I am able to see only value. I want once the grid will be loaded the values should be converted to corresponding display automatically by looking into the combo box value-display pair.
I have attached an image for better understandings. Any kind of help is much appreciated.

Best regards,
Biswajit

biswajit.rout
4 Dec 2012, 3:16 AM
Forgot to mention that i am using Extjs 4.1

Ratan
16 Jan 2013, 12:28 PM
I am having the same issue with 4.1

Alexander Bauer
16 Jan 2013, 12:34 PM
Don't know if this is a real bug, however you could use a renderer on that column:


{
...
renderer : function(value) {
// better if you can reference the combo outside of the renderer
// (e.g. if you create the grid within initComponent)

var retVal = '';
var cmb = Ext.ComponentManager.query(comobox[...])[0];
if(cmb) {
var record = cmb.findRecord(cmb.valueField, value);
retVal = record.get(cmb.displayField);
}

return retVal;
}

}

Ratan
21 Jan 2013, 7:49 AM
Alexander, thanks for your reply. I am concerned about the the migration, if I have to migrate my existing 3 apps to 4, I will have to add renderer everywhere. This looks like a bug to me or may be there is some property that needs to be set to enfore value selection for the combo.

I had somewhat same kind of problem with FormPanel where a combo would display valuefield when corresponding value is not found in the options, I found a fix to use enforceSelection=true on combo and it worked.

Thanks,
Ratan