0

When I expand a node on one table it is expanding other table automatically. How can I prevent that. Also, I have two different data for tow tables. But it is appending to both dataset.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Md Rahaman
  • 101
  • 1
  • 2
  • 8

2 Answers2

0

Yes. I have done that. And I also have two different onChange method for both table an updated my my data based on the event. But it seems like both of the table expanding upon clicking one icon.

Md Rahaman
  • 101
  • 1
  • 2
  • 8
-1

I assume you will be assigning the 2 different variables to [value]="files1" of your tree data table value attribute.

this value attribute value defines the values to be shown in the data table. for an example, if you have 2 data sets and wants to populate it on 2 tree table you need to assign 2 variable like

files1: TreeNode[];
files2: TreeNode[];

this TreeNode should be imported from import {TreeNode} from 'primeng/api';

in your function from which you are getting values to show assign your values to above-mentioned files variable like

this.files1 = files1;
this.files2 = files2;

and in your view pass this files1 in tree table value attribute

<p-treeTable [value]="files1">

similarly, for second tree table pass this value like

<p-treeTable [value]="files2">
Hrishikesh Kale
  • 6,140
  • 4
  • 18
  • 27