Im using Footable for my data. here's an official example. With beakpoints i can hide some data and expand it when necessary... But i want to expand one row at a time and close the other expanded rows.
With Footable i figured out i can access the event of expanding a row like:
$("#footableID").on("expand.ft.row", function (e, ft, row) {
var rows=$('#footableID tbody').children("tr");
// hide expanded data
});
but i cant find a way to hide the expanded rows... I tried removing the data-expanded="true" attribute to the rows,but that dosnt seems to work... also, im not sure if children is the best way to access the rows
ok, so "find" is a better way to acces row childs, and when you got a expanded row, you have to trigger a click to close it. ...if i understand correctly expand.ft.row occurres before it is actually expanded
$("#tabla").on("expand.ft.row", function (e, ft, row) {
$('#tabla tbody').find('tr').each(function(){
if (this.getAttribute("data-expanded")){
this.click();
}
})
});