3

I have a tree table with three level hierarchy. I'm getting this hierarchy by sending data in three different Observable list.

int pnode = 0;
        if (parentData != null && parentData.size() > 0) {
            for (ProjectPlan parent : parentData) {
                root.getChildren().addAll(new TreeItem<>(parent));
                childData = new ArrayList<>();
             int cnode = 0;
                for (ProjectPlan child : childData) {
                    root.getChildren().get(pnode).getChildren().addAll(new              TreeItem<>(child));
                    grandChildData = new ArrayList<>();

                    });
                    int gcnode = 0;
                    for (ProjectPlan grandChild : grandChildData) {
                        root.getChildren().get(pnode).getChildren().get(cnode).getChildren().addAll(new TreeItem<>(grandChild));
                        gcnode++;
                    }
                    cnode++;
                }
                pnode++;
            }
        }

Now In my result I have a column scope which has data yes or no. I have to filter this column as yes, no or both. I used the following code to but It didn't work.

tbScope.addEventHandler(ColumnFilterEvent.FILTER_CHANGED_EVENT, new EventHandler<ColumnFilterEvent<S, T, IFilterOperator<?>, IFilterEditor<R>>>);

Please help me in filtering the table according to this data. The table looks like follows.

Parent    Child   GrandChild   Scope
>A                              Yes
            B                   Yes
 >          C                   No
                     D          No
                     E          No
>F                              yes
 >          G                   yes
                     I          no
                     J          yes

I want to filter this scope column. Please help.

Alexander O'Mara
  • 58,688
  • 18
  • 163
  • 171
Harshita Sethi
  • 2,035
  • 3
  • 24
  • 46
  • Could this help ? http://stackoverflow.com/questions/26072510/how-to-implement-filtering-for-treetableview – JeffProd Jun 05 '16 at 16:41

0 Answers0