1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-03 07:03:33 +02:00
10 1.09 Submit and reset button
koalyptus edited this page 2017-12-08 21:59:54 +11:00

Properties

Property Type Description Remarks Example
btn boolean if set true shows validation button in the grid (default - false) var tfConfig = { btn: true}
btn_text string changes the text of the validation button var tfConfig = { btn_text: "Filter" }
btn_css_class string defines the css class of the validation button var tfConfig = { btn_css_class: "myClass" }
btn_reset boolean|object if set true, it will show a "Reset" button at the top-right corner of the table allowing users to the filters (default - false)
var tfConfig = { btn_reset: true };
// or
var tfConfig = { 
  btn_reset: {} 
};
        
target_id string defines the id of the element that will contain the reset button (default - null)
var tfConfig = { 
  btn_reset: {
    target_id: 'myContainerId'
  } 
};
        
text string sets text for the "Reset" button (default - null)
var tfConfig = { 
  btn_reset: {
    text: 'Clear all'
  } 
};
        
html string defines 'reset' button HTML (default - null) note that the onclick event is added automatically to the html element and overwrites any eventual onclick attribute
var tfConfig = { 
  btn_reset: {
    html: ''
  } 
};
        
css_class string defines the css class of the reset button (default: 'reset')
var tfConfig = { 
  btn_reset: {
    css_class: 'my-css-class'
  } 
};
        
tooltip string defines the tooltip of the reset button (default: 'Clear filters')
var tfConfig = { 
  btn_reset: {
    tooltip: 'Clear all filters'
  } 
};
        
toolbar_position string defines where it will be placed inside the toolbar (default - 'right') 3 possible values: 'left', 'center' and 'right'
var tfConfig = { 
  btn_reset: {
    toolbar_position: 'center'
  } 
};
        

Callbacks

Property Type Description Remarks Example
on_before_reset function callback function fired before filters are cleared note that 2 parameters are passed to the callback function:
  • tf is the current TableFilter instance
  • filterValues: an array containing the filters' values
var tfConfig = { on_before_reset: function(tf, filterValues){ alert('Filters values to be cleared: '+filterValues); }}
on_after_reset function callback function fired after filters are cleared note that one parameter is passed to the callback function:
  • tf is the current TableFilter instance
var tfConfig = { on_after_reset: function(tf){ alert('Filters are cleared'); }}