Spreadsheet Column Filters
This section provides details about the row filters in Jspreadsheet CE.
Differences in the Pro Version
The Pro version provides multi-column filters, support for filtering specific columns or cell ranges, sorting ranges, additional events, and extensive customization options, with excellent compatibility with other spreadsheet software.
Learn more
Documentation
Methods
Method | Description |
---|---|
openFilter() |
Opens the filter input.openFilter(columnNumber: Number, getAsSets?: boolean): void |
closeFilter() |
Closes the filter input.closeFilter(): void |
resetFilters() |
Resets all applied filters.resetFilters(): void |
Initial Settings
Property | Description |
---|---|
filters: boolean|string |
Start the spreadsheet with the filters enabled. Default: false |
Enabling Spreadsheet Filters
To activate a filter for a specific column, use the filter attribute in the column object during spreadsheet initialization:
A | B | |
1 | Jazz | Honda |
2 | Civic | Honda |
3 | Civic | Honda |
4 | Picanto | Kia |
5 | Optima | Kia |
<html>
<script src="https://bossanova.uk/jspreadsheet/v5/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jspreadsheet/v5/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<div id="spreadsheet"></div>
<script>
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
['Jazz', 'Honda'],
['Civic', 'Honda'],
['Civic', 'Honda'],
['Picanto', 'Kia'],
['Optima', 'Kia'],
],
filters: true,
}]
});
</script>
</html>