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

Bug: Derived Attrs error #53

Closed
andflechas opened this issue Oct 31, 2013 · 2 comments
Closed

Bug: Derived Attrs error #53

andflechas opened this issue Oct 31, 2013 · 2 comments
Labels

Comments

@andflechas
Copy link

Hello,

First of all, thanks for such a wonderful work!. I was playing around with the derived attributes and I found the following error when you are trying to use it.

Uncaught TypeError: Object [object global] has no method 'splice'

My solution was to omit the removeAt key in the deriveAttributes function and it worked.

deriveAttributes = function(record, derivedAttributes, f) {
var k, v, _ref, _ref2;
console.log(derivedAttributes);
for (k in derivedAttributes) {
if(k!="removeAt"){ // I Included this
v = derivedAttributes[k];
record[k] = (_ref = v(record)) != null ? _ref : record[k];
}
}
for (k in record) {
if (!__hasProp.call(record, k)) continue;
if ((_ref2 = record[k]) == null) {
record[k] = "null";
}
}
return f(record);
};

Hope its the right approach,

Thanks,

Andrés.

@nicolaskruchten
Copy link
Owner

Thanks for this Andrés! Can you explain to me how to reproduce this bug? Does it happen with any of the examples here? http://nicolaskruchten.github.io/pivottable/examples/

@andflechas
Copy link
Author

Actually, I tried it and it didn't happen with any of the examples . It should be something by my side. Let me check and I'll let you know. Thanks

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

No branches or pull requests

2 participants