-2

I have created a nested table and it gets toggled (show/hide )on click of a cell. When i click a cell,it hides and when i click again it is visible. This functionality is working absolutely fine as expected. I have a requirement where on the initial load of thr table the nested table should be hidden and only during the click Of cell,it should be visible. I have tried some table callbacks like table building and table built function ( http://tabulator.info/docs/4.0/callbacks ) to hide the nested one,but its not working as expected. Please help me at the earliest.

I have done the nested table scenario with reference from : Show/Hide or Toggle Nested Table Child In Tabulator

Thanks Ajith

Ajith
  • 87
  • 3
  • 12
  • Please provide a [minimal, complete, and verifiable example](https://stackoverflow.com/help/mcve). – Constantin Groß Oct 08 '19 at 13:26
  • *"I have tried some table callbacks to hide the nested one"* Could you add your attempt in the question? *"but its not working as expected"* is way to general, what did you expect and what differs from the expectation? – 3limin4t0r Oct 08 '19 at 13:29
  • Yes,i have updated the question with the specific callback functions. – Ajith Oct 08 '19 at 13:36

2 Answers2

3

It depends heavily on how you have setup your table, but working from the link you had in your example, you should set the style display to "none" after creating the table element, that way it will start hidden.

var tableEl = document.createElement("div");
tableEl.style.display = "none"; //start with table element hidden

You may need to call the redraw function on the child table when it is first shown if there are any rendering issues

Oli Folkerd
  • 7,510
  • 1
  • 22
  • 46
0

Are you using jQuery to hide/show the table? If so you can add style="display:none" as an attribute on the table element which will cause it to be hidden initially.

example:

<table style="display:none">
 ...

and in your JavaScript:

$('table').show()
jakecyr
  • 136
  • 6