I'm trying to return a string array. It needs to be in format:
Area: ["0","1","2"]
So this works
Area: ($("#output").find('.pvtUi .pvtRows').text())!=null ?["0"]: ["1","2"]
but not this one
Area: function(){
if ($("#output").find('.pvtRows').text()!=null) {
val=["0"];
return val;}
else return ["1","2"];
}
I've tried all sorts of options. I'm trying to return inclusion list for pivottable.js https://github.com/nicolaskruchten/pivottable/wiki/Parameters any help would be appreciated...
If you need your function to be inline, then you can convert it to an IIFE (immediately invoked function expression).
Eg:
In your case this would be:
the alternative is to define your function as a function and call it: