PDA

View Full Version : Does Grid support formatting and links in grid cells



jdaum
22 Apr 2007, 4:21 PM
Hi,

I would like to convert an existing CRUD application into one using grids for viewing data. However some rows will need to contain on eof the following things:
- <span> with background color
- links that go to external pages
- javascript that opens external pages


Is this possible with the extjs grid? I have seen you can create cell-listeners. To allow me to transition I would like to defer this to later.

Thanks for any comments and help.

Jochen

sfwalter
22 Apr 2007, 5:28 PM
yes you can do formatting at either the row or cell level. To do formatting at cell level you can setup a renderer. Here is an example of a column definition in the column model:
{
header: 'Priority',
width:100,
sortable:true,
dataIndex: 'priority',
renderer: function(data, cell, record, rowIndex, columnIndex, store) {
cell.css = "redcell"; //set the css class of the cell
data = "<strong>" + data "</strong>"; //wrap html around the cell data
}

Hope this helps