I have a column that renders based on the value of a previous column in the record.
If the value matches, it should display a checkbox but instead, it’s displaying on the grid as [object Object]
Can anyone suggest what I need to add to show this?
,{id:'review', header: "Acknowledge Review", width: 80, sortable: true, dataIndex: 'review', renderer: function(value, meta, record, id){
var id = Ext.id();
var content = record.data['status'];
if(content.match(/^(VIEWED)$/i))
{
var checkBox = new Ext.form.Checkbox({
checked: false
}); //.render(document.body, id);
//checkBox.applyTo('review');
return checkBox;
}
}}
You are getting
[object Object]because ExtJS uses the returned value as a string (therefore object’stoStringmethod is called internally).rendererfunction should return html markup, not javascript object.For instance, you could try returning something like the following: