Pivot2.0 JavaScript Column Width
My PivotTable has 3 columns. I want javascript to set the width of Column2 to 10px. I've already changed the contents of Column2 to all empty strings.
I tried DOM-manipulation. The Pivot DOM structure is complicated; even if I succeed, the resulting code will be hard to maintain and vulnerable to future changes by Sisense.
Has someone done this before, either using DOM-manipulation or a better way?
Tim von Ahsen
Posted 6 months agoยทLast reply 5 months ago
1 comment
Piotr_qbeeq
ยท5 months agoHi Tim
I haven't tested this personally, so please treat it as a suggestion to try out โ but I think the most maintainable approach here is scoped CSS using nth-child, rather than direct DOM manipulation.
Instead of fighting the Pivot DOM structure, you can inject a scoped <style> tag tied to your widget's ID in the widget's Script panel:
Why this approach:
One thing worth checking: if your Pivot 2.0 runs on ag-Grid (the case in newer Sisense versions), the nth-child index might be offset depending on whether row headers are rendered as separate cells. So if column 2 doesn't respond, try adjusting the index (2, 3, or 4) until you hit the right one.
Let us know if this approach works for your use case โ or if you find a better solution, feel free to share it in this thread.
Best Regards,
Piotr from QBeeQ, a Sisense Gold Implementation Partner
www.qbeeq.io