Skip to content

Instantly share code, notes, and snippets.

@techjewel
Last active October 11, 2023 21:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techjewel/7f994b08909e2cb0e64f41b0019cb06d to your computer and use it in GitHub Desktop.
Save techjewel/7f994b08909e2cb0e64f41b0019cb06d to your computer and use it in GitHub Desktop.
Ninja Tables Custom JS Snippets for many functionalities
// By default ninja tables keeps open each row for expanding
// You can add the following js then it will keep expanded one row at a time
var currentExpandRow = false;
$table.on('expanded.ft.row', function (e, ft, selfArg) {
if(currentExpandRow == selfArg) {
return;
}
currentExpandRow = selfArg;
ft.rows.collapse();
selfArg.expand();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment