Search code examples
tabulator

Hiding nested table on initial load


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


Solution

  • 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