开发者

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;
                              }
                          }}开发者_如何学运维 


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>';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜