PDA

View Full Version : Grid rowexpander and summery and row body



RC_ants
23 Sep 2009, 4:31 AM
We have a grid that has the row expander and summery plugin.
Both work fine, but we want an extra line of data beneath the row, where the expander will expander from.

Something like this.

(collapsed row)
[name][column3]
Details bla bla bla

[I](expanded row)
[id][name][column3]
Details bla bla bla
[Expended row data]

The reason we want this is that we put an editor in the extended section of the row and the detail information under the row that should always be visible.
Please do not post any alternative solutions to our layout solution. This is want our customer wants.

The detail row can be filled directly with the record of the row. But if we can access it on creation it also ok.

RC_ants
23 Sep 2009, 4:45 AM
One of the solutions I tried is making the last column of the grid create a new row with the renderer.

Like this
</td></tr><tr><td>

Although a dirty a solution it works partly. It breaks the expander plugin as it cannot longer find the body on beforeExpand.

If you like to try this and fix this solution.

Here is the renderer for that last collumn


renderer: function(v, p, record){
//close cell, close row, create new row, cell open tag
return '</td></tr><tr><td colspan="9">' + v;
}And here it goes wrong within the rowexpander


beforeExpand : function(record, body, rowIndex){
if(this.fireEvent('beforeexpand', this, record, body, rowIndex) !== false){
if(this.tpl && this.lazyRender){

//THIS ROW HERE
body.innerHTML = this.getBodyContent(record, rowIndex);

}
return true;
}else{
return false;
}
},