Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

filterAll is not a function #5

Open
shovondu86 opened this issue Oct 31, 2018 · 5 comments
Open

filterAll is not a function #5

shovondu86 opened this issue Oct 31, 2018 · 5 comments

Comments

@shovondu86
Copy link

dctable

@gordonwoodhull
Copy link
Collaborator

Thanks @shovondu86! It's easy to lose track of all the smaller features. This one is listed in the SO answer which serves as de facto documentation for this topic, which I'll double check when I fix this soon.

@Dakdeniz
Copy link

Dakdeniz commented Jan 8, 2019

Just adding filterAll function with the same functionality of _table.redraw works.

_table.filterAll = function() {
            _dt.clear()
                .rows.add(_dimension.top(Infinity))
                .draw();
        }; ```

@YendorMc
Copy link

YendorMc commented Dec 6, 2020

HI
I added Dakdeniz's code in dc.datatable.js after _table.redraw @ line 117.

I now get get "DataTables warning: table id=DataTables_Table_0 - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3"

Any thoughts as to what else can be the issue?

@gordonwoodhull
Copy link
Collaborator

@YendorMc, I can’t think of any reason why this code would work for redraw but not for filterAll.

Just to confirm, do you mean that you get the warning when you click the ‘Reset All’ link? Or some other time?

@YendorMc
Copy link

YendorMc commented Dec 6, 2020

Yes - I do get the warning when I do "Reset All' (it's an alert), or also when I have a preset "View" when I set filters on 'presets'
e.g.

function filterit(filters){
	dc.filterAll();

	if (filters == "Region 1"){
		isStateSelect.filter([["AR ","TX ","AL "]])
	}
	else if (filters == "Region 2"){
		isStateSelect.filter([["FL ","GA "]])
	}
    dc.renderAll();
 };

It does work after the popup warning, but would be nice to figure out the annoying popup warning.

On a side note - dc.js is absolutely amazing, Gordon!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants