diff --git a/layouts/shortcodes/apisetschema_table.html b/layouts/shortcodes/apisetschema_table.html
index d72c987..14f40f5 100644
--- a/layouts/shortcodes/apisetschema_table.html
+++ b/layouts/shortcodes/apisetschema_table.html
@@ -28,7 +28,7 @@
apiset |
{{ range $all_versions }}
- {{ . }} |
+ {{ . }} |
{{ end }}
@@ -69,44 +69,36 @@
return data;
}
},
- targets: '_all'
+ targets: 'version-col'
},
],
initComplete: function () {
this.api()
- .columns()
+ .columns('.version-col')
.every(function () {
let column = this;
- column.render = function ( data, type, row ) {
- return '$'+ data;
- }
-
// Create select element
let select = document.createElement('select');
select.add(new Option(''));
+ select.add(new Option('yes'));
+ select.add(new Option('no'));
let hdr = $(column.header());
$('
').appendTo(hdr);
$(select).appendTo(hdr).click(function(e) { e.stopPropagation(); });
- //column.header().replaceChildren(select);
// Apply listener for user change in value
select.addEventListener('change', function () {
- var val = DataTable.util.escapeRegex(select.value);
-
+ let search_for = '';
+ if (select.value == 'yes') {
+ search_for = '.+';
+ } else if (select.value == 'no') {
+ search_for = '^$';
+ }
column
- .search(val ? '^' + val + '$' : '', true, false)
+ .search(search_for, true, false)
.draw();
});
-
- // Add list of options
- column
- .data()
- .unique()
- .sort()
- .each(function (d, j) {
- select.add(new Option(d));
- });
});
}
});