Tree Table for Mutiple Colum

Hi,
I need to create Treetable which depends for Different Columns and also column3 column has to be editable.

When I click on USA, NewYork tree table should get displayed. After When I click on Newyork column3 should be displayed and also be editable. Could you please anyone help me.


Say for example
Columns1 Columns2 Column3
USA NewYork 10000
20000
Thanks

hmmmmmm

Hi, I tried below code, but Groups are created single column only.

// Add Table columns
treetable.addContainerProperty(“Name”, String.class, “”);
treetable.addContainerProperty(“Hourse Done”, Integer.class, 0);
Object year2010 = treetable.addItem(
new Object { “Year 2010”, 18 }, null);
Object customerProject1 = treetable.addItem(new Object {
“Customer Project 1”, 13}, null);
Object customerProject1Implementation = treetable.addItem(new Object {
“Implementation”, 5 }, null);
Object customerProject1Planning = treetable.addItem(new Object {
“Planning”, 2 }, null);
Object customerProject1Prototype = treetable.addItem(new Object {
“Prototype”, 5}, null);
Object customerProject2 = treetable.addItem(new Object {
“Customer Project 2”, 5 }, null);
Object customerProject2Planning = treetable.addItem(new Object {
“Planning”, 5 }, null);

    // Set hierarchy
    //treetable.setParent(year2010, allProjects);
    
    treetable.setParent(customerProject1, year2010);
    treetable.setParent(customerProject1Implementation, customerProject1);
    treetable.setParent(customerProject1Planning, customerProject1);
    treetable.setParent(customerProject1Prototype, customerProject1);
    treetable.setParent(customerProject2, year2010);
    treetable.setParent(customerProject2Planning, customerProject2);
    // Disallow children from leaves
    treetable.setChildrenAllowed(customerProject1Implementation, false);
    treetable.setChildrenAllowed(customerProject1Planning, false);
    treetable.setChildrenAllowed(customerProject1Prototype, false);
    treetable.setChildrenAllowed(customerProject2Planning, false);
    // Expand all
    treetable.setCollapsed(year2010, false);
    treetable.setCollapsed(customerProject1, false);
    treetable.setCollapsed(customerProject2, false);

Could you please anyone reply for above code… thanks

Any update please vaadin fever.

sure ,please, give me couple of time ,i will let u know… :slight_smile:

regards,
vaadin fever,

Thank you. Waiting for your reponse.

Hello Sakthiplan,

I actually don’t understand your problem really. Your code is quite different to your starting question.

Could you please write what exactly you are trying to achieve?

Here is an example of a multi column TreeTable. Maybe you find here what you need

http://demo.vaadin.com/book-examples/book/#component.treetable.draganddrop

Hi Sir,
Could you please look into attached Screenshot.

Column1 depends on Child(Column2).

Thanks you Sir

14163.png

Hi,
I looking for Mutil Row Tree Table. But you have given muti column example.
Please find attached screenshot.
Will you please look into this issue Sir. I am waiting for your response.

Thank you

14163.png

Please find attached Screenshot. You will be getting clear idea.

14163.png

Hello Sakthiplan,

after watching the same screenshot three times I got the idea :wink:

What you want is a data source container with the properties “column 1”, “column 2” and “column 3”.
All objects need the three properties. But the parent object has set the property “column 1” with value and the “column 2” and “column 3” with no values (or empty string).
Your children need to have “column 2” filled and your grandchildren have to have “column 3” filled but not the rest.

I hope that was clear :slight_smile:

Yes, You are 100% Clear. is it possible? Provides sample if you have Any Please

Hello,

I just wrote it down fast. But it should work that way

TreeTable ttable = new TreeTable();
ttable.addContainerProperty("1", String.class, "");
ttable.addContainerProperty("2", String.class, "");
ttable.addContainerProperty("3", String.class, "");
ttable.addItem(new Object[]{"USA", null, null}, "usa");
ttable.addItem(new Object[]{null, "NY", null}, "ny");
ttable.addItem(new Object[]{null, null, "123"}, "nychild1");
ttable.addItem(new Object[]{null, null, "124"}, "nychild2");
ttable.setParent("nychild1", "ny");
ttable.setParent("nychild2", "ny");
ttable.setParent("ny", "usa");

Or use
MCont add on

Hi Wolfgang Wachsmuth,

Thanks for the code which you have provided, Please take a look below as a result of the code run; given by you.


1 | 2 | 3 |

[b]

[/b] USA | | |

            |        NY        |                   |

but, What am looking for is


1 | 2 | 3 |

[b]

[/b] USA | | |

            | [b]

[/b] NY | |

           |                      |     123        |

           |                      |     124        |

But , in your code below line is not working as expected.


ttable.setParent(“nychild1”, “ny”);
ttable.setParent(“nychild2”, “ny”);

I’ll Explain in detail for the below table for my requirement

  1. USA is a Parent of NY and CAL
  2. NY is a child for USA, but parent for 123 and 124
  3. CAL is a child for USA, but parent for 125 and 126

If i click USA corresponding childs (i.e, NY and CAL should be expanded)
If i click NY corresponding childs (i.e, 123 and 124 should be expanded)
If i click CAL corresponding childs (i.e, 125 and 126 should be expanded)

Hope you will get clear idea about my requriement…


1 | 2 | 3 |

[b]

[/b] USA | | |

           | [b]

[/b] NY | |

           |                     |     123        |

           |                     |     124        |

           | [b]

[/b] CAL | |

           |                      |     125        |

           |                      |     126        |

Thank you

Hi,
I am waiting for your response. Please

Thanks

Will you please anyone work

working on it

Thank you