Maintain Pivot Table State After Refresh

I am adding data on the fly to pivot table when realtime data is pushed to my webapp. But whenver I call refresh after adding data, the pivot table loses the collapsed/expanded pivots. I want to somehow add the data silently without the user required to navigate to the section he/she was looking at it by going through all the expansion/collapse again.

Thanks,
Vivek.

Correction: By refresh, I mean I am adding rows by using parse method. I tried getState() method but isnt working.

Hello,
Could you, please, show a snippet of your implementation?

The pivot doesn’t have an option for such hidden data adding, but the next can be done

  1. stableRowId enabled for the pivot -
    https://docs.webix.com/api__ui.pivot_stablerowid_config.html
  2. add a handler to the datatable inside of the pivot and attach it to onAfterOpen event. From event handler, get open-state of branches by using getState API
  3. add a handler to onAfterRender of a pivot and from it call setState to apply state of branches back

. I tried getState() method but isnt working.

  • be sure that you are working with datatable inside of the pivot, not the pivot itself
  • be sure that stableRowId is enabled, as by default row IDs can change between repaints