pm13
pm13

Reputation: 745

EXTJS Checkbox showing as [object Object]

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;
                              }
                          }} 

Upvotes: 0

Views: 1126

Answers (1)

Li0liQ
Li0liQ

Reputation: 11264

You are getting [object Object] because ExtJS uses the returned value as a string (therefore object's toString method is called internally).

renderer function should return html markup, not javascript object.

For instance, you could try returning something like the following:

return '<input type="checkbox">input</input>';

Upvotes: 2

Related Questions