在单元格的渲染函数中定义:
me.columns = [
{ text: '创建时间', dataIndex: 'createtime', width: 150 },
{ text: '更新时间', dataIndex: 'updatetime', width: 150 },
{ text: '角色中文名', dataIndex: 'rolenamecn', width: 150 },
{ text: '角色英文名', dataIndex: 'rolename', width: 150 },
{ text: '拥有的权限', dataIndex: 'permissionlist', width: 250,
renderer: this.autoRowHeight
}
],
autoRowHeight: function(value, metaData, record, rowIndex, colIndex, store, view) {
//ExtJS3中实现自适应行高
/*metadata.attr = 'style="white-space:normal;"';
return value;*/
//ExtJS4中实现自适应行高
return '<div style="white-space:normal;">' + value + '</div>'
}