PDA

View Full Version : Grid Html



karthik085
2 Jul 2010, 12:42 PM
Hi,
How can I get grid to display HTML itself rather than text?
Thanks,
K

Animal
2 Jul 2010, 12:43 PM
Use a column renderer.

karthik085
2 Jul 2010, 12:51 PM
What do I specify in this renderer?

'this' keyword is basically pointing to a function that extends GridPanel

this.columns = [{
id: 'body',
header: "body",
dataIndex: 'body',
sortable:true,
width: 420,
renderer: this.formatHTML
}];



Use a column renderer.

Condor
2 Jul 2010, 11:27 PM
You don't need a renderer to display HTML in a grid cell. GridPanel will do this by default.

The only problem you could have is that Ext applies a lot of styling to the grid, which is also applied to your HTML. So you might need some extra css rules to make your HTML look the way you want.

Animal
3 Jul 2010, 12:03 AM
You don't need a renderer to display HTML in a grid cell. GridPanel will do this by default.

The only problem you could have is that Ext applies a lot of styling to the grid, which is also applied to your HTML. So you might need some extra css rules to make your HTML look the way you want.

Well, only if your Store contains Fields which are textual HTML.

Which should not be the case. Stores should contain data.

If you need to make a grid cell "decorative" while the Field it is displaying is pure data, then you will need a renderer.