Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the Hierarchical Grid?

Grid Hierarchical
0
0 Posted

What is the Hierarchical Grid?

0
0

Hierarchical Grid extends the Editable Grid and supports all the same features. Additionaly it allows you to display subgrids related to particular cells of the main grid. Editable hierarchicalModel = new HierarchicalGridDataModel(null); // create a new grid panel GridPanel panel = new GridPanel(); // create a new editable grid and put it into the panel HierarchicalGrid grid = (HierarchicalGrid) panel.createEditableGrid ( new String[]{“Department”,”Number of Employees”}, new Class[]{LabelCell.class, IntegerCell.class}, hierarchicalModel ); // add a grid panel factory to the second column grid.addGridPanelFactory( 1,new GridPanelFactory() { public GridPanel create(GridDataModel model) { GridPanel panel = new GridPanel(); // create a new grid here return panel; } public GridDataModel create(int parentRow, GridDataModel parentModel) { return new EditableGridDataModel(new Object[0][0]); } } ); // display all panel.display(); Hierarchical Grid initialization is similar to the previous one.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123