Expand my Community achievements bar.

Sorting tables?.

Avatar

Level 3

Hi, is there a way to sort a table after such table received data from an external source? (xml), since the former one is not sorted.

Thanks!.

5 Replies

Avatar

Level 10

You will have to put the data into an array and then use the method sort

e.g.

var tabData = new Array("Zuchini","Banana","Apple","Orange","Pineapple");

tabData.sort();

xfa.host.messageBox(tabData.join(", ")); -->Apple, Banana, Orange, Pineapple, Zuchini

Avatar

Level 3

I see, but, Im not sure I understand how to go from binded fields to pass the array data to the fields.

Avatar

Level 10

I don't know I never worked with binded fields yet, maybe you would have to take binding off and insert values manually from the array into fields instead of having binded fields...

not sure

Avatar

Level 3

Mhh.. I'll give it a try, I guess I can do that in the calculate event of that subform.

Avatar

Level 10

Hi,

John Brinkman has a sample of sorting subforms on his blog, I think sorting a table would be very similiar, http://blogs.adobe.com/formfeed/2009/05/sort_subforms.html

Regards

Bruce