Datatable full child row
Datatable full child row
dathtit
Posts: 7Questions: 0Answers: 0
Hi everyone
First, thank Alan for the new row child feature in the new Datatable 1.10 version.
Here's the question:
I want to create child row width the same format as parent row. It's like simply add a row to the table with the same column.
But now, the row child added always be put in a element with colspan like this
1
2
3
How can it just simply be like this :
1
2
3
I have try all the type of parameter can be put in row.child() : string, jquery, array but it just can't happen.
Please show me how to do this, or at least the code to fix this.
Thanks
First, thank Alan for the new row child feature in the new Datatable 1.10 version.
Here's the question:
I want to create child row width the same format as parent row. It's like simply add a row to the table with the same column.
But now, the row child added always be put in a element with colspan like this
1
2
3
How can it just simply be like this :
1
2
3
I have try all the type of parameter can be put in row.child() : string, jquery, array but it just can't happen.
Please show me how to do this, or at least the code to fix this.
Thanks
This discussion has been closed.
Replies
And have the child row matching the parent columns.
Looking at the code, I think I see the problem: https://github.com/DataTables/DataTablesSrc/blob/master/js/api/api.row.details.js#L8
> toUpperCase() !== 'tr'
doh... It should be `TR` .
I'm not in the office at the moment, but when I am I'll test and commit that.
Allan
Anyway, I found a way to fix this temporarily.
In this function, just make row._details = $(data);
var __details_add = function ( ctx, row, data, klass )
{
// Convert to array of TR elements
//var rows = [];
//var addRow = function ( r, k ) {
// if ( ! r.nodeName || r.nodeName.toUpperCase() !== 'tr' ) {
// r = $('').find('td').html( r ).parent();
// }
// $('td', r).addClass( k )[0].colSpan = _fnVisbleColumns( ctx );
// rows.push( r[0] );
//};
//if ( $.isArray( data ) || data instanceof $ ) {
// for ( var i=0, ien=data.length ; i
Allan
Hello Allan,
Can you share the part of the code that'll fix it. What dathtit said is not working for me.
Thank you