J
John_Woo
Hi,
let's say I want the UI JTable like:
-----------------------------------------------------------------------------------------------------
Economy VS. Population
-----------------------------------------------------------------------------------------------------
Col_1-Region 2-GDP 3-Population
4-...
-----------------------------------------------------------------------------------------------------
World % million
...
A |-North.America
AB1 |-U.S.
AB2 |-Canada
ABC1 |-B.C
ABC2 |-ON
ABCD1 |-Toronto
ABCD2 |..
AB2 |-Mexico
B |-Europe
|--
C |-Asia
|-
It doesn't have to look as above, but the main point is, when clicking
on "2-GDP" header-column, tree-data should be sorted based on values on
that colunm.
The sort-rules are:
1. At least sort one level, ex. re-arrange A,B,C,etc
2. then sort to the lowest visible node, ex. re-arrange all ABs, then
for AB2 (Canada), re-arrange ABCs and then for ABC2, re-arrange
ABCDs;
3. for nodes become visible, sort them when clicking on the
header-column
Can any one have idea/example?
I'm wondering, what's the idea to sort it.From sun's web, I found the example showing how to creaet treetable.
let's say I want the UI JTable like:
-----------------------------------------------------------------------------------------------------
Economy VS. Population
-----------------------------------------------------------------------------------------------------
Col_1-Region 2-GDP 3-Population
4-...
-----------------------------------------------------------------------------------------------------
World % million
...
A |-North.America
AB1 |-U.S.
AB2 |-Canada
ABC1 |-B.C
ABC2 |-ON
ABCD1 |-Toronto
ABCD2 |..
AB2 |-Mexico
B |-Europe
|--
C |-Asia
|-
It doesn't have to look as above, but the main point is, when clicking
on "2-GDP" header-column, tree-data should be sorted based on values on
that colunm.
The sort-rules are:
1. At least sort one level, ex. re-arrange A,B,C,etc
2. then sort to the lowest visible node, ex. re-arrange all ABs, then
for AB2 (Canada), re-arrange ABCs and then for ABC2, re-arrange
ABCDs;
3. for nodes become visible, sort them when clicking on the
header-column
Can any one have idea/example?