on 06-08-2007 10:32 AM
Hello,
I am using the TableSorter object in order to sort Dynpro tables.
Suppose I have requirement to sort according 2 columns,
I mean one primary and second secondary.
The situation now is every click on another column cancel the first sort.
I'll appreciate any suggestion.
Thanks,
Maya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use sort method on your data node like:
node.sortElements(new Comparator() {
public int compare(Object o1, Object o2) {
<MyElType> el1 = (MyElType) o1;
<MyElType> el2 = (MyElType) o2;
if(e1.getClm1().compareTo(e1.getClm1())==0) {
// sort by second column only if in first column we have the equals values
return e1.getClm2().compareTo(e1.getClm2());
} else {
return e1.getClm1().compareTo(e1.getClm1());
}
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What about creating a pushbutton that when pressed will trigger a pop-up dialog box. In this box list the column headers and the user can enter a number next to each column header to define the sort order?
It's not ideal but will achieve sorting on multiple columns.
Gareth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.