Hola,
ya está solucionado - dejo el código a continuación por si ha alguien le interesa.
Código Javascript
:
Ver original<script>
$(document).ready(function () {
$("table tbody span.ui-icon-triangle-1-s").click(function(){
var row_tr = $(this).parent().parent().parent().attr("id");
var detail = $("#detail_" + row_tr);
if ( $(this).hasClass("ui-icon-triangle-1-n") ) {
detail.remove();
}else{
var tr = $(this).parent().parent().parent();
$.post('url.php', function(html) {
tr.after("<tr id='detail_" + row_tr + "'><td colspan='4'>"+ html +"</td></tr>");
});
}
$(this).toggleClass('ui-icon ui-icon-triangle-1-n ui-icon ui-icon-triangle-1-s');
});
});
</script>
Código HTML:
Ver original<div class="box_results"><img src="lib/images/icons/png/excel.png"/></div> <table id="table-sorter" class="table_data"> <th colspan="3"> </th> <td class="icon-td"><div id="icons" class="box_icon ui-state-default ui-corner-all"><span class="ui-icon ui-icon-triangle-1-s"></span></div></td> <td class="icon-td"><div id="icons" class="box_icon ui-state-default ui-corner-all"><span class="ui-icon ui-icon-triangle-1-s"></span></div></td>
saludos