Row details + multiple tables, a combination without future?
Row details + multiple tables, a combination without future?
Hi all!
Anyone know and can tell me how to combine the examples of these two pages?
http://www.datatables.net/release-datatables/examples/api/row_details.html
http://www.datatables.net/release-datatables/examples/basic_init/multiple_tables.html
That is, how to start all the row details in a multiple tables page at once?
Thanks in advance for your answers!
Luys
P.S.: Obviously I try again and again without success...
Anyone know and can tell me how to combine the examples of these two pages?
http://www.datatables.net/release-datatables/examples/api/row_details.html
http://www.datatables.net/release-datatables/examples/basic_init/multiple_tables.html
That is, how to start all the row details in a multiple tables page at once?
Thanks in advance for your answers!
Luys
P.S.: Obviously I try again and again without success...
This discussion has been closed.
Replies
you should affect the coutner to $.fn.dataTableExt.iApiIndex
like this :
$.fn.dataTableExt.iApiIndex =$(this).parents('table').attr('id');
$.fn.dataTableExt.iApiIndex =////0 or 1 or 2
change $(#example .....) to $(.dataTable.......) in head tag
step 2:
change
$('.dataTable thead tr').each( function () {
this.insertBefore( nCloneTh, this.childNodes[0] );
} );
to
$('.dataTable thead tr').each( function () {
this.insertBefore( nCloneTh.cloneNode(true), this.childNodes[0] );
} );
Step 3:
$('.dataTable tbody td img').live('click', function () {
/***********************************************
*******************MY EDIT*********************
***********************************************/
var nTr = $(this).parents('tr')[0];
var nTt = $(this).parents('table')[0];
var oTable = $(nTt).dataTable();
/*
***********************************************
*/
if ( oTable.fnIsOpen(nTr) )
{
/* This row is already open - close it */
var file = this.src.split("/");
if(file[file.length-1] == 'details_close.png')
this.src = "asset/images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
var file = this.src.split("/");
if(file[file.length-1] == 'details_open.png')
this.src = "asset/images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
step4:
Note: You must have file:
assets/images/.....+details_open.png +details_close.png
assets/js/jquery.js and jquery.dataTable.js
assets/css/demo_page.css and demo_table.css
}
} );
I will try as soon as possible.
Luys