PDA

View Full Version : Change CSS of a row in column spec of a grid



geewhizbang
10 Aug 2009, 11:37 AM
From my reading of the doc, this should work, but doesn't.
Adding the CSS (in bold below) should give me what I want for a cell.

What is the right way to do this?




{
ThreadSummary : function(value, p, r)
{
return String.format
(
'<div class="SD_CellTitleLink CB">{0}</div><div class="SD_CellText FL"><span class="SD_lbl">by</span> {1}</div><div class="SD_CellDate">{2}</div>',
value, r.data.CreatedBy, r.data.CreatedDate.dateFormat('g:i a M j, Y')
);
}
}
KnowledgeBase.Forums.Forum.ThreadData = new Ext.data.DirectStore
(
{
directFn: DirectRequest.GetThreadsByForumId,
paramsAsHash: false,
paramOrder: 'ForumID',
baseParams: { ForumID: fid },
idProperty: 'ThreadID',
fields:
[
{name: 'ThreadID', type: 'int'},
{name: 'ThreadName', type: 'string'},
{name: 'ForumID', type: 'int'},
{name: 'CreatedBy', type: 'string'},
{name: 'ModifiedBy', type: 'string'},
{name: 'ModifiedDate', type: 'date'},
{name: 'CreatedDate', type: 'date'},
{name: 'NumberOfPosts', type: 'int'},
{name: 'NumberOfTags', type: 'int'}
],
remoteSort: false
}
);

KnowledgeBase.Forums.Forum.ThreadGrid = new Ext.grid.GridPanel
(
{
renderTo: 'divForum',
frame: false,
stripeRows: false,
scroll: false,
autoHeight:true,
columnLines:true,
autoWidth:true,
disableSelection: true,
trackMouseOver: false,
ds: KnowledgeBase.Forums.Forum.ThreadData,
columns:
[
{header: 'Thread', width:400, css: 'myCss', sortable:true, dataIndex: 'ThreadName', renderer: KnowledgeBase.Forums.Forum.Renderers.ThreadSummary },
{header: 'Posts', width:60, sortable:true, dataIndex: 'NumberOfPosts', renderer:KnowledgeBase.Forums.Renderers.Posts }
],
listeners: { CellClick: ForumThreadClick }
}
)