fnClose not closing

fnClose not closing

mrkevansmrkevans Posts: 17Questions: 0Answers: 0
edited December 2009 in General
I'm working with the hide/show hidden example. i have it pretty much copied verbatim.

the open/close part works fine. the icons are also switching. however the fnClose(nTr) does not work.

Yet i can easy do $(nTr).next().remove(). and that works.

[code]
$("#admin_user_logs_table td img").live("click", function () {

var nTr = this.parentNode.parentNode;
if ( this.src.match('details_close') )
{
/* This row is already open - close it */
this.src = "/img/details_open.png";
$(nTr).next().remove();
//logTable.fnClose( nTr );
}
else
{
/* Open this row */
this.src = "/img/details_close.png";
logTable.fnOpen( nTr, fnFormatLogDetails(nTr), 'details' );
}

});
[/code]

Everything else is working nicely.

When testing with Firebug, i can see that the variable nTr is the row containing the close/open icon. So i am assuming that the fnClose function actually just takes the row after the row with the clicked icon and removes it.

Am i correct?

Am i doing something wrong?

Replies

  • ajosephdesignajosephdesign Posts: 5Questions: 0Answers: 0
    If you are using server-side processing fnClose() doesn't work. Check out the initialization code here » http://datatables.net/examples/server_side/row_details.html

    I use basically the same method you use above to achieve the task.
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi folks,

    fnClose should work on server-side processing as shown in the example ajosephdesign linked to. Could someone perhaps post an example which doesn't work?

    @mrkevans: The way the open/close functions work is to 'attach' a child row to a parent (not in the DOM sense of course), so it doesn't just blindly remove the next TR in the table. So I'm not sure what is going on here at the moment to be honest :-)

    Regards,
    Allan
This discussion has been closed.