Skip to content

Commit a363f69

Browse files
authored
Merge pull request #160 from nexB/158-hide-all-columns
Create button to hide all columns but "Path" #158
2 parents c920f51 + cd962d6 commit a363f69

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

assets/js/aboutCodeDataTables.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@ class AboutCodeDataTable {
248248
extend: "colvisGroup",
249249
text: "Show all columns",
250250
show: ":hidden"
251+
},
252+
{
253+
// Hide all columns except Path
254+
extend: "colvisGroup",
255+
text: "Hide all columns",
256+
show: AboutCodeDataTable.LOCATION_COLUMN
257+
.map((column) => `${column.name}:name`),
258+
hide: AboutCodeDataTable.TABLE_COLUMNS
259+
.filter((column) => AboutCodeDataTable.LOCATION_COLUMN.indexOf(column) < 0)
260+
.map((column) => `${column.name}:name`)
251261
}
252262
],
253263
dom: // Needed to keep datatables buttons and search inline

0 commit comments

Comments
 (0)