I'm still new to Javascript and HTML, I'm trying to create a table to display reports extracted from firebase RT Database.
I'm Getting the following Error:
Uncaught TypeError: this.options.data.slice is not a function
at Tabulator._clearObjectPointers (tabulator.js:9532)
at Tabulator._create (tabulator.js:9488)
at new Tabulator (tabulator.js:8715)
at tableCreator (index.html:705)
at index.html:804
at EventRegistration.ts:133
at kt (util.ts:588)
at jr.raise (EventQueue.ts:171)
at Vr.raiseQueuedEventsMatchingPredicate_ (EventQueue.ts:123)
at Vr.raiseEventsForChangedPath (EventQueue.ts:103)
any help please
What I have tried:
var jsonData =
{
availability: {
supermarket01: {
'2342342': {
green100: 'no',
green200: 'yes',
red200: 'yes',
yellow: 'no',
purple100: 'yes',
cyan100: 'no'
},
'58943792': {
green200: 'yes',
orange200: 'yes',
red200: 'no'
},
'398489593': {
green200: 'no',
orange200: 'no',
red200: 'yes'
},
'1605290957000': {
orange: 'yes',
green2123: 'no',
green222: 'yes'
}
},
supermarket02: {
'23423423': {
green200: 'yes',
orange200: 'no',
red200: 'no'
},
'23947928': {
green200: 'yes',
orange200: 'no',
red200: 'yes'
}
}
}
}
const table = new Tabulator("#example-table", {
layout: "fitColumns",
autoRows: true,
dataTreeChildField: "childRows",
autoColumns: true,
dataTree: true,
resizableColumns: false,
data: jsonData,
selectable: true,
});
<div id="example-table"></div>