0

triggering grid column sorting from java code

asked 2014-02-22 20:02:09 +0800

udayabaski gravatar image udayabaski
29 1

Hi, I have 2 grids with similar columns. I want to do sorting of 2nd grid also when clicking the first grid column. Is there any way we can simulate the click in java code or call the method which is being called when we do click to sort?

Thanks, Baskar.S

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-02-23 12:13:29 +0800

udayabaski gravatar image udayabaski
29 1

Hi, Thanks for your reply. Both are different object. I feel, I can use onSort(SortEvent e) in this case.

Thanks, Baskar.S

link publish delete flag offensive edit

Comments

Yes you are right, I did read your question bad, I was thinking you wanten to sort the seconde column. Use of the onsort is indeed the best solution. Or if u use MVVM just use the same command that triggers the storting for both grids. Greetz

chillworld ( 2014-02-23 17:40:11 +0800 )edit
0

answered 2014-02-22 21:33:23 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

If the column 1 refers to the same object of colomn 2, you just need to implement the Comparable interface in your object (or use an comparator if its already implemented and you may not change it) where you also insert the value of the second column.

Then its done automaticly.

Greetz chill.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-02-22 20:02:09 +0800

Seen: 9 times

Last updated: Feb 23 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More