[filter_box] option to delay filtering with apply button (#2338)

* [filter_box] delayed filtering with apply button

* Remove lingering console.log statement
This commit is contained in:
Maxime Beauchemin
2017-03-06 13:31:00 -08:00
committed by GitHub
parent b4a96bd840
commit af3415b040
5 changed files with 41 additions and 12 deletions

View File

@@ -101,10 +101,9 @@ class ChartContainer extends React.PureComponent {
height: getHeight,
setFilter: () => {
// set filter according to data in store
// used in FilterBox.onChange()
},
setFilter: () => {},
addFilter: () => {},
getFilters: () => (
// return filter objects from viz.formData

View File

@@ -840,6 +840,17 @@ export const controls = {
description: 'Font size for the biggest value in the list',
},
instant_filtering: {
type: 'CheckboxControl',
label: 'Instant Filtering',
renderTrigger: true,
default: true,
description: (
'Whether to apply filters as they change, or wait for' +
'users to hit an [Apply] button'
),
},
show_brush: {
type: 'CheckboxControl',
label: 'Range Filter',

View File

@@ -607,7 +607,7 @@ const visTypes = {
{
label: null,
controlSetRows: [
['date_filter'],
['date_filter', 'instant_filtering'],
['groupby'],
['metric'],
],

View File

@@ -244,11 +244,11 @@ const px = function () {
resize() {
this.render();
},
addFilter(col, vals) {
controller.addFilter(sliceId, col, vals);
addFilter(col, vals, merge = true, refresh = true) {
controller.addFilter(sliceId, col, vals, merge, refresh);
},
setFilter(col, vals) {
controller.setFilter(sliceId, col, vals);
setFilter(col, vals, refresh = true) {
controller.setFilter(sliceId, col, vals, refresh);
},
getFilters() {
return controller.filters[sliceId];