Code:
var alerts = Ext.create('Ext.grid.Panel', { id: 'alerts-list',
title: 'Alerts',
//iconCls: 'icon-info',
hideHeaders: true,
margin: '0 5 20 5',
collapsible: true,
collapsed: true,
autoHeight: true,
store: {
fields: ['message', 'tipmessage', 'type'],
data: [{
'message': '<span class="author">Joe Smith</span><h1>Here is my internal note:</h1><span class="meta">April, 23 2011 2:15pm</span><br /> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
type: 'note',
'tipmessage': '<span class="author">Joe Smith</span><h1>Here is my internal note:</h1><span class="meta">April, 23 2011 2:15pm</span> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p><a href="">12345678</a>'
}, {
'message': '<h1>High Priority:</h1><span class="meta">April, 23 2011 2:15pm</span><br />Nam sapien ligula, consectetuer id, hendrerit in, cursus sed',
type: 'high',
'tipmessage': '<h1>High Priority:</h1><span class="meta">April, 23 2011 2:15pm</span><br /><p>Nam sapien ligula, consectetuer id, hendrerit in, cursus sed</p>',
}, {
'message': '<h1>Medium Priority Alert:</h1><span class="meta">April, 23 2011 2:15pm</span><br />ut nibh bibendum imperdiet. Curabitur neque mauris, porta vel, lacinia quis',
type: 'medium',
'tipmessage': '<h1>Medium Priority Alert:</h1><span class="meta">April, 23 2011 2:15pm</span><br />ut nibh bibendum imperdiet. Curabitur neque mauris, porta vel, lacinia quis'
}, {
'message': '<h1>Low Priority:</h1><span class="meta">April, 23 2011 2:15pm</span><br />Nullam ultrices, nisi quis scelerisque convallis, augue neque tempor enim',
type: 'low',
'tipmessage': '<h1>Low Priority:</h1><span class="meta">April, 23 2011 2:15pm</span><br />Nullam ultrices, nisi quis scelerisque convallis, augue neque tempor enim'
}]
},
columns: [{
dataIndex: 'type',
width: 30,
renderer: function (value, meta) {
//custom class on this cell for icon indicator
if (value === 'high') {
meta.tdCls = 'icon-high icon';
return 'high';
} else if (value === 'medium') {
meta.tdCls = 'icon-medium icon';
return 'medium';
} else if (value === 'low') {
meta.tdCls = 'icon-low icon';
return 'low';
} else if (value === 'note') {
meta.tdCls = 'icon-note icon';
return 'note';
}
}
}, {
tdCls: 'x-td-white-space-normal',
dataIndex: 'message',
flex: 1
}]
});