is there any way to sort tabel data in livecycle like in excel or word tables?
Views
Replies
Total Likes
Hi,
John Brinkman has a sample here where he sorts a group of subforms. http://blogs.adobe.com/formfeed/2009/05/sort_subforms.html
It should be possible to adapt this to sort rows, but I haven't tried it.
Good luck,
Niall
Views
Replies
Total Likes
I put the attached together to demonstrate sorting a static table. If you have a dynamic table then changes will be required. The table header row contains three buttons. When you click Club, Home or Founded all three columns are sorted. I just reverse sort on each click.
I attached the same script to the click event of all three buttons. Optimize as you see fit. The click event on the Club button is as follows:
// form1.page1.table.header.clubBtn::click - (JavaScript, client)
var clubArray = new Array();
var homeArray = new Array();
var foundedArray = new Array();
for (var i=0; i < 4; i++) {
var club = xfa.resolveNode("form1.page1.table.row[" + i + "].club").rawValue;
clubArray.push(club);
var home = xfa.resolveNode("form1.page1.table.row[" + i + "].home").rawValue;
homeArray.push(home);
var founded = xfa.resolveNode("form1.page1.table.row[" + i + "].founded").rawValue;
foundedArray.push(founded);
}
clubArray.reverse();
homeArray.reverse();
foundedArray.reverse();
for (var i=0; i < 4; i++) {
xfa.resolveNode("form1.page1.table.row[" + i + "].club").rawValue = clubArray[i];
xfa.resolveNode("form1.page1.table.row[" + i + "].home").rawValue = homeArray[i];
xfa.resolveNode("form1.page1.table.row[" + i + "].founded").rawValue = foundedArray[i];
}
Steve
Views
Replies
Total Likes
Hi,
I don't think this will work. The reasons are:
1) Here all the sample data considered is in ascending order
2) Since the data is already organized in asc order, the reverse function works well in all the cases.
This doesn't seem to be a full pledged sorting.
Thanks,
VJ
Views
Replies
Total Likes
Hi, Document attached doesnt work, could you share it to me please? uaembo@gmail.com
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies