nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.34k stars 1.07k forks source link

Not able to view Pivot Table #1238

Open vk30688-ops opened 3 years ago

vk30688-ops commented 3 years ago

I am using Pivot.js and my table on display file is

<!DOCTYPE html>

CIMS | PIVOT

The above is calling gchart_vendor_supp which is data source file. I have observed that hard coded data source file is getting called but with database connected source file, the pivot table does not get displayed. Please help

6188800 commented 7 months ago

I was struggling with an issue similar to this one.

Working: array embedded in the HTML Broken: array loaded into a variable via another script

The console for the broken version pointed to a derived attribute. Derived Attribute functions worked just fine as long as I didn't apply a function to the source attribute. e.g. "new attribute": function(row){return row["old_attribute"] + ' ' + row["another_attribute"]} would work but "new attribute": function(row){return row["old_attribute"].slice(0,3)} would not.

After a lot of hair pulling I realized that some of my "old_attributes" were coming back as undefined. Once I started checking for that in my functions the issue was resolved.

e.g. "new attribute": function(row){val = row["old_attribute"] ; if ( typeof val != 'undefined' ) { return val.slice(0,3) } }