PDA

View Full Version : How To Manage TAG HTML in a renderer of an EditorGrid?



axelaxel
8 Jul 2010, 11:30 PM
hi guys,
i've an EditorGrid and my problem is the following:

i've a column which editor is a combobox, and the values received by the combobox are id numbers => in the renderer i've the parser to set an image, depending by the value.

the problem i've is that while i open the combobox, to chose another value, the cell of the grid where initally there was the image selected, shows the html code of the image.
i attach a photo of the mistake, to make it clearer.

any ideas how to solve it?
i search on the forum, but i couldn't find any solutions
thank you


axel


21368





var cmRenderStatus = function cmRenderSiNo(v, params, record, rowIndex, columnIndex, store) {
switch(v){
case 0:
case 1:
case 2:
case '0':
case '1':
case '2':
sImageName = v;
break;

default:
sImageName = 'X';
break;
}

return '<img src="/project/bostik/html/css/icons/' + sImageName + '.png">';
};
var cmEditorStatus = function () {
return new Ext.form.ComboBox({
mode: 'local',
editable: false,
typeAhead: true,
triggerAction: 'all',
displayField: 'value',
valueField: 'id',
validateOnBlur: false,
listWidth: 40,
store: new Ext.data.SimpleStore({
fields: ['id', 'value'],
data: [
['0', '<img src="/project/bostik/html/css/icons/0.png">'],
['1', '<img src="/project/bostik/html/css/icons/1.png">'],
['2', '<img src="/project/bostik/html/css/icons/2.png">']
]
})
});
};

13 Jul 2010, 4:20 AM
The combo box doesn't work this way. YOu can't inject raw HTML into an input field.