addAutofilter - cfsimplicity/spreadsheet-cfml GitHub Wiki
Adds dropdown autofilters to the specified range of cells.
addAutofilter( workbook[, cellRange, row ] )
Required arguments
workbook
spreadsheet object
Optional arguments
cellRange
string: the cell range reference where the filters should appear in the form "A1:Z1"row
numeric default=1: ifcellRange
is missing or empty, apply the autofilters to this entire row
Chainable? Yes.
Notes
- Autofilters are UI controls allowing the user to only show rows where the column contains the chosen value.
- You set them on columns in one row only, normally the first.
- If you don't specify a cell range or row, the autofilters will be applied to all columns in the first row.
- The
cellRange
argument overrides anyrow
specified. - Ranges containing multiple rows will ignore all but the first specified row.
Examples
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget" ] ] )
workbook = spreadsheet.workbookFromQuery( data )
spreadsheet.addAutofilter( workbook ) //apply to all columns in the first row
workbook2 = spreadsheet.workbookFromQuery( data )
spreadsheet.addAutofilter( workbook2, "A1" ) //apply just to the first column