mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-05-03 07:03:33 +02:00
Page:
1.0 Configuration
Pages
1.0 Configuration
1.01 Appearance
1.02 Main features
1.03 Grid layout
1.04 Paging
1.05 Drop down filter
1.06 Checklist filter
1.07 Rows counter
1.08 Loading indicator
1.09 Submit and reset button
1.10 Status bar
1.11 Data types
1.12 Themes
1.13 Help instructions
1.14 Popup filters
1.15 No results message
1.16 Highlight keywords
1.17 State
1.18 Mark active columns
1.19 Toolbar
1.20 Single filter
2.0 TableFilter class
2.1 Public properties
2.2 Public methods
3.0 Extensions
3.1 Advanced grid
3.1 Sort
3.2 Column operations
3.3 Filters visibility
3.4 Columns visibility
4. Filter operators
Home
Obsolete
TODO
9
1.0 Configuration
koalyptus edited this page 2023-05-12 21:18:48 +10:00
In this section you will find all the configuration options (const tfConfig = { property: 'value' }
).
Here is a more extensive example showing many of the features and options including texts in German:
const tf = new TableFilter(my_table, {
base_path: 'tablefilter/', // Needed to resolve additional resources (css, extensions, etc.) at runtime
auto_filter: { delay: 500 }, // Delay for automatic filtering (milliseconds)
state: { // Enable state persistence
types: ['local_storage'], // Possible values: 'local_storage' 'hash' or 'cookie'
filters: true, // Persist filters values, enabled by default
columns_visibility: true, // Persist columns visibility
filters_visibility: true, // Persist filters row visibility
},
sticky_headers: true, // Sticky headers with overrides
alternate_rows: true, // Enable alternating rows
mark_active_columns: { // Mark active columns
highlight_column: false, // .. but only the column header
},
grid_layout: false, // Grit layout (but no simple copy&paste to Excel anymore)
filters_row_index: 0, // Row index to show the filter bar (default 0).
// Show filter bar above header allows easy copy&paste of the table content.
toolbar: true, // Enable toolbar component
rows_counter: { text: 'Rows: ' }, // Enable rows counter UI component
status_bar: { // Enable status bar UI component
msg_filter: 'Filter aktiv...', // Message during filtering
toolbar_position: 'center',
},
btn_reset: { // Enable clear button
tooltip: 'Filter löschen',
toolbar_position: 'right',
},
locale: 'de', // Define default locale, default to 'en'
thousands_separator: '.', // Define thousands separator ',' or '.', defaults to ','
decimal_separator: ',', // Define decimal separator ',' or '.', defaults to '.'
empty_operator: '[empty]',
nonempty_operator: '[nonempty]',
help_instructions: { // Instructions text (accepts HTML)
text :
'Filter-Operatoren:<br /> ' +
'<b><</b>, <b><=</b>, <b>=</b>, <b>>=</b>, <b>></b>, <br />' +
'<b>*</b>, <b>!</b> (nicht), <b>{</b> (beginnt mit), <b>}</b> (endet mit), <br />' +
'<b>||</b> (oder),<b> &&</b> (und),<br />' +
'<b>[empty]</b>, <b>[nonempty]</b>, <b>rgx:</b><br />' +
'<a href="' +
'https://github.com/koalyptus/TableFilter/wiki/4.-Filter-operators' +
'" target="_blank">' +
'Weitere Informationen</a><hr/>'
,
btn_text : '?', // btn_text oder btn_html
},
no_results_message: { // "No results" message
content: 'Keine zum Filter passende Einträge vorhanden',
},
loader: false, // Loading indicator, { html : '...' }
watermark: [ 'Filter...', ], // Repeated watermark text for input fields or watermark for each filter if an array is supplied
extensions:[ // Extensions load addititional script files
{
name: 'colsVisibility',
description: 'Sichbarkeit der Spalten verwalten', // Module description
enable_hover: true, // Enable hover behaviour on columns manager button/link
btn_text: 'Spalten verstecken▼', // Button's text, defaults to Columns▼
//at_start: [3, 4], // List of columns indexes to be hidden at initialization
tick_to_hide: true, // Enable tick to hide a column, defaults to true
text: 'Versteckte Spalten: ', // Text preceding the columns list, defaults to 'Hide' or 'Show'
btn_close_text: 'Schließen', // Columns manager UI close link text, defaults to 'Close'
enable_tick_all: false, // Enable select all option, disabled by default
tick_all_text: 'Alle auswählen:', // Text for select all option, defaults to 'Select all:'
toolbar_position: 'right', // Default position in toolbar ('left'|'center'|'right')
},
{
name: 'filtersVisibility',
description: 'Sichtbarkeit der Filter', // Module description
visible_at_start: true, // Make filters visible at initialization, defaults to true
enable_icon: true, // Enable expand/collapse icon, defaults to true
btn_text: 'Filter', // Custom text for button
toolbar_position: 'right', // Default position in toolbar ('left'|'center'|'right')
},
//{ name: 'sort' } // Sort requires to classify numeric columns using "col_types : [ 'numeric', String', ...],"
],
});
tf.init();