Show Details
Show Details
tzoneso
Posts: 2Questions: 0Answers: 0
Hi,
I'm using the latest version of datatables and jquery ui but I've a problem using show details and pagination.
Using :
[code]
$('#example tbody td img').live('click', function () {
var nTr = this.parentNode.parentNode;
if ($(this).parent().attr('id') != 'empty'){
if ( this.src.match('details_close') )
{
/* Dettagli aperti - chiudili */
this.src = "../../img/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* visualizza dettagli per questa riga */
this.src = "../../img/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
}
}
});
[/code]
when i click on show details it work fine only in the first page, in the others pages if i click on details the table return to the first page but if i came back on the correct page i saw details shown.
I've tried 'on' instead of 'live' but the event click is attached only to the first page.
how can avoid this?
I'm using the latest version of datatables and jquery ui but I've a problem using show details and pagination.
Using :
[code]
$('#example tbody td img').live('click', function () {
var nTr = this.parentNode.parentNode;
if ($(this).parent().attr('id') != 'empty'){
if ( this.src.match('details_close') )
{
/* Dettagli aperti - chiudili */
this.src = "../../img/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* visualizza dettagli per questa riga */
this.src = "../../img/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' );
}
}
});
[/code]
when i click on show details it work fine only in the first page, in the others pages if i click on details the table return to the first page but if i came back on the correct page i saw details shown.
I've tried 'on' instead of 'live' but the event click is attached only to the first page.
how can avoid this?
This discussion has been closed.
Replies
in my [code]function fnFormatDetails ( oTable, nTr)[/code]
i had this :[code]oTable.fnDraw(true);[/code] I remove it and now it work with 'live'.
How could i do if i want to use on instead of live event?