PDA

View Full Version : Add a second row above the data row in a grid



deepthi
28 Nov 2007, 11:50 PM
How to add a second row/div above the data row in a grid ,so that the 2nd row/grid doesnt resize with the data rows and remain static.I could find the enableRowBody:true but this adds a row below the data row ,I need a row to be aded above the data row .Can someone help me in this regard .


Deepthi

deepthi
7 Dec 2007, 1:56 AM
can anyone help me please ....

phillroberts
7 Dec 2007, 2:56 AM
Looking at the source for the GridView, I see that there is a private initTemplates method with templates used for displaying the grid. You could extend the GridView class and update the row template to do what you need it to do.

The section of code looks like this:


if(!ts.row){
ts.row = new Ext.Template(
'<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',
'<tbody><tr>{cells}</tr>',
(this.enableRowBody ? '<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>' : ''),
'</tbody></table></div>'
);
}
Swapping the two rows may be sufficient for your needs.
If I had to do this though, I'd probably go a little further and add an option to specify where the rowBody should appear and add a conditional to the above if statement. That way it can show up above or below the actual row with data.

Warning: I haven't tried this myself and have NO IDEA of any side effects (if any).

Good luck,

Phill

deepthi
11 Dec 2007, 11:28 PM
hey thanks a lot Phill......
I lost hope that no one was replying ........
will work on ur pointers thanks ..........