Column filters
Enable column filters on your javascript dynamic tables.
<html>
<script src="https://jspreadsheet.com/v7/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v7/jspreadsheet.css" type="text/css" />
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<div id="spreadsheet"></div>
<script>
let data = [
['US', 'Cheese', '2019-02-12'],
['CA', 'Apples', '2019-03-01'],
['CA', 'Carrots', '2018-11-10'],
['BR', 'Oranges', '2019-01-12'],
];
jspreadsheet(document.getElementById('spreadsheet'), {
data: data,
columns: [
{ type: 'autocomplete', url:'/jspreadsheet/countries', width:'200px', },
{ type: 'text', width:'200px', },
{ type: 'calendar', width:'200px', }
],
filters: true,
license: 'NmFlZmFjYWNjNTA1OGJmODM0NWFkZGNhY2I4MjM2MDA0MzE5MTRlZGVkMTA1ODZlZmQ5ODM1MWJhOTRlM2E4ZTYxMTVkMmJjYzc4MzZlZmYxNzBkZDI4MDlhMjM5NTc0MmNjYTMxNDllMTg3OGZlZWI4YzJlOWJjNTNlNmZmODQsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpNME9UUTJOakkyTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==',
});
</script>
</html>
Related methods
Method | Description |
---|---|
filter | filter(integer columnNumber, Object values) Apply filters programatically. |
Related events
Events | Description |
---|---|
onbeforefilter | onbeforefilter(DOMElement el, Array filters, Array data) Action to be executed before filtering rows. It can cancel the action by returning false. |
onfilter | onfilter(DOMElement el, Array filters, Array data) After the filter has been applied to the rows. |