TreeTable with different column containing tree

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

TreeTable with different column containing tree

Postby jaredmac » Wed Aug 23, 2006 9:20 am

I am wondering if it's possible to have a column other than the first column contain the tree parts in a TreeTable?

It looks like there are methods in TreeTable that can be overridden to do this, but I was wondering what the best technique was.

Thanks,
Jared
jaredmac
 
Posts: 216
Joined: Wed Mar 08, 2006 12:42 pm

Postby JIDE Support » Wed Aug 23, 2006 9:27 am

You can try to override this method in TreeTable. See below for default implementation. But I can't gurantee the mouse click will work as it doesn't know which column has +/- icon.

Code: Select all
    public TableCellRenderer getCellRenderer(int rowIndex, int columnIndex) {
        if (columnIndex == 0) {
            if (_renderer instanceof TreeTableCellRenderer) { // always true
                TableCellRenderer renderer = super.getCellRenderer(rowIndex, columnIndex);
                ((TreeTableCellRenderer) _renderer).setActualCellRenderer(renderer);
            }
            return _renderer;
        }
        else {
            return super.getCellRenderer(rowIndex, columnIndex);
        }
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 54 guests