Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pivot.cofee(extra null check added to avoid error in case there is no filter data) #1039

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/pivot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -982,15 +982,15 @@ callWithJQuery ($) ->
exclusions = {}
@find('input.pvtFilter').not(':checked').each ->
filter = $(this).data("filter")
if exclusions[filter[0]]?
if filter and exclusions[filter[0]]?
exclusions[filter[0]].push( filter[1] )
else
exclusions[filter[0]] = [ filter[1] ]
#include inclusions when exclusions present
inclusions = {}
@find('input.pvtFilter:checked').each ->
filter = $(this).data("filter")
if exclusions[filter[0]]?
if filter and exclusions[filter[0]]?
if inclusions[filter[0]]?
inclusions[filter[0]].push( filter[1] )
else
Expand Down Expand Up @@ -1095,7 +1095,8 @@ callWithJQuery ($) ->
forEachCell = (f) =>
@find(scope).each ->
x = $(this).data("value")
f(x, $(this)) if x? and isFinite(x)
f(x, $(this)) if x?
isFinite(x)

values = []
forEachCell (x) -> values.push x
Expand Down