Detail of Detail is not working properly
Detail of Detail is not working properly
Hi everyone!
My problem is the following:
I have a page that has a table in wich each row has a detail, but not only that (we already
have an example on this link http://datatables.net/release-datatables/examples/api/row_details.html).
In my case, each "detail" is a table(datatable) that also has details(datatable).
Kinda:
Well, my details are working properly in the first level, and when I
push the (+) button to open a detail of the level 2, it works properly, however,
when I open another detail of the level 2.. I cannot
close the detail that I had opened at first (at level 2).
The most strange is that I can continue opening new details... but I cannot
close the detail above.
Looks like that it's working upsidedown.
The name of the tables for details are created dinamically and all listerners
works dinamically.
For example
$(TB_NAME + ' tbody td img').live('click', function () {
var nTr = $(this).parents('tr')[0];
if (this.src.match('view_out')) {
/* This row is already open - close it */
this.src = '<%= Url.Content("~/Content/imagens/view_in.png")%>';
_tblDeclaracoes.fnClose(nTr);
}
else {
/* Open this row */
this.src = '<%= Url.Content("~/Content/imagens/view_out.png")%>';
$(TB_NAME).dataTable().fnOpen(nTr, fnFormatDetails($(TB_NAME).dataTable(), nTr), 'detail');
}
});
When I run the function fnClose(nTr), it returns 0 when I have only 1 detail opened,
but when I open a new detail.. the functions returns 1.
Allan, what could I do?
Best regards,
Dan
My problem is the following:
I have a page that has a table in wich each row has a detail, but not only that (we already
have an example on this link http://datatables.net/release-datatables/examples/api/row_details.html).
In my case, each "detail" is a table(datatable) that also has details(datatable).
Kinda:
Well, my details are working properly in the first level, and when I
push the (+) button to open a detail of the level 2, it works properly, however,
when I open another detail of the level 2.. I cannot
close the detail that I had opened at first (at level 2).
The most strange is that I can continue opening new details... but I cannot
close the detail above.
Looks like that it's working upsidedown.
The name of the tables for details are created dinamically and all listerners
works dinamically.
For example
$(TB_NAME + ' tbody td img').live('click', function () {
var nTr = $(this).parents('tr')[0];
if (this.src.match('view_out')) {
/* This row is already open - close it */
this.src = '<%= Url.Content("~/Content/imagens/view_in.png")%>';
_tblDeclaracoes.fnClose(nTr);
}
else {
/* Open this row */
this.src = '<%= Url.Content("~/Content/imagens/view_out.png")%>';
$(TB_NAME).dataTable().fnOpen(nTr, fnFormatDetails($(TB_NAME).dataTable(), nTr), 'detail');
}
});
When I run the function fnClose(nTr), it returns 0 when I have only 1 detail opened,
but when I open a new detail.. the functions returns 1.
Allan, what could I do?
Best regards,
Dan
This discussion has been closed.