TreeTable Component used in TabPanel is unmounted onTabChange

UI Components for React
Post Reply
jake02
Posts: 5
Joined: 28 Oct 2018, 01:40

28 Oct 2018, 02:25

I have a use case in which I am dynamically creating the TabPanels based on category and further dynamically creating a TreeTable component inside the rendered TabView. The rendering works perfectly. The issue I'm running into is that when I change the tab, the TreeTable in the current tab is unmounted and I lose the state of the selected elements. I need for the selections to persist through the tab changes.

Is there a way for the TabPanel to not unmount components that are rendered inside? If this isn't possible, is there a way of passing in what parent/child nodes need to be selected to a TableTree component when a previous tab has been clicked?

Thanks all for any help.

merve7
Posts: 861
Joined: 12 Sep 2017, 10:44

31 Oct 2018, 14:50

Not yet, but we will add to support for render attribute inside tabs for next versions.
You can follow from this link; https://github.com/primefaces/primereact/issues/618

jake02
Posts: 5
Joined: 28 Oct 2018, 01:40

01 Nov 2018, 02:32

Given that the prop for rendering isn't available at the moment, could I get some advice on passing data node into TreeTable in which the children have 'selected' elements?
I realize there is TreeNode, but I'm not sure exactly how to populate that with values that are selected that would further be passed into the 'selection' prop? Thanks for the support. - J

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Nov 2018, 15:52

New RC1 will come out this week with the new renderActiveOnly for TabView and the all new TreeTable.

jake02
Posts: 5
Joined: 28 Oct 2018, 01:40

08 Nov 2018, 18:41

Just took a peek at all the stuff coming done the pike on TabPanel and TableTree - LOOKING GOOD!!

Thanks for all the hard work guys!

J

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests