Position of TreeTable expand column

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Position of TreeTable expand column

Postby camerong » Mon Jul 16, 2007 5:05 pm

I am wanting to create a table based on TreeTable but where the first column is a checkbox rather than the TreeTable. The checkbox is used to enable/disable the row. Is it possible to define at which column the 'TreeTable' starts?? An example could be in Microsoft project where it is possible to have columns in front of the 'Task Name' column which is the expandable column.

I could not see any examples that demonstrated this.

Thanks,

Cameron
camerong
 
Posts: 56
Joined: Wed May 23, 2007 5:45 pm

Postby JIDE Support » Mon Jul 16, 2007 6:09 pm

You can call setExpandableColumn to set which column to have the +/- icon.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby camerong » Mon Jul 16, 2007 7:36 pm

When I tried this method it did not appear to work. I basically added in this line to the sample code provided for the TreeTable example as follows

---------------------------
if (type == MultiTableModel.HEADER_COLUMN) {
TreeTable treeTable = new TreeTable(model);
treeTable.setRowHeight(18);
treeTable.setShowTreeLines(true);
<b>treeTable.setExpandableColumn(1)</b>;
return treeTable;
}

---------------------------

When this value is set the +/- do not show on the specified column index, however, they are removed from the first column. Expanding the tree still works on the default column (0) by 'double-clicking' even though the +/- are removed.

Could you indicate whether I have called this method in the wrong place?

Thanks,

Cameron
camerong
 
Posts: 56
Joined: Wed May 23, 2007 5:45 pm

Postby JIDE Support » Mon Jul 16, 2007 7:54 pm

That's the expected behavior. Double click will always expand/collapse no matter where you click. Single click will only work on +/- icon.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Postby camerong » Mon Jul 16, 2007 9:28 pm

The problem is that when I call setExpandableColumn() I do not see the +/- icon on the column index that I have specified.

e.g. If the column model has 4 columns and I call setExpandableColumn(2) then I would expect to see the +/- icon on column at index 2 but it does not appear. I addition to this the double-click behaviour does not work on the column with index 2, it occurs on the column with index 0 which is the default column index.

I cannot get the setExpandableColumn() to behave as expected. Could you confirm that the code supplied in my previous post is correct and that you can get the expected behaviour if you do a similar test

Regards,

Cameron
camerong
 
Posts: 56
Joined: Wed May 23, 2007 5:45 pm

Postby JIDE Support » Mon Jul 16, 2007 9:57 pm

I didn't realize you are using TableScrollPane. I don't know what you have in your MultiTableModel's getColumnType method. But please note, the index you set should be the model index. We will use convertColumnIndexToView(_expandableColumn) to convert the index you set. Depending the return of getColumnType, the column you set could be hidden in the header table.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Position of TreeTable expand column

Postby Symphony.Teleca » Mon Mar 29, 2021 6:41 am

Dear JIDE support,
I have the same problem: I have a table with 3 columns, and I need to display groups at column 3 (column Index==2). I also display the table inside table scroll pane and use code from you examples for creating table scroll pane.
getColumnType for my model looks like this:
Code: Select all
   @Override
   public int getColumnType( int aColumnIndex )
   {
      return aColumnIndex == 2  ? HEADER_COLUMN : REGULAR_COLUMN;
   }
What I expected is to see groups displayed at THIRD column. What I actually see is what in the tablescrollpane my third column has been moved to the first position, and group are displayed in the first column!
Please advise what to do to see treetable inside the tablescrollpane to display groups in the third column.
Some code samples would be very helpful.

--
Thanks
Symphony.Teleca
 
Posts: 18
Joined: Tue Aug 20, 2013 10:52 pm

Re: Position of TreeTable expand column

Postby JIDE Support » Tue Mar 30, 2021 3:42 pm

It is not possible. All header columns will be moved to the beginning. That's how it was designed and have to be done this way.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 7 guests

cron