Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

COLUMN SORTING

Jannae72
Level 4
Level 4

The attached document is used by our selection panel and I have been asked if there is a possibility of adding a 'Sort' button.  This button will automaticall sort the column 'Total including weighting (if applicable)' column into descending order.

Just wondering if this possible and what the coding would be.

Regards

Jenny

0 Replies
Kevin_McHale
Level 2
Level 2

You're also iterating through the list in an unexpected way. You won't get the JavaScript errors if you iterate like this:

var rows = xfa.resolveNodes("Detail[*]");

for (var i = 0; i < rows.length; i++) {

     rows.item(i).Number.rawValue = i + 1;

}

Jannae72
Level 4
Level 4

Hi Kevin,

I added the Javascript to the 'Sort' Button but came up with an error.

I am a newbe at all this (self taught) and don't really understand what the coding means or what I haven't done.

I have attached what I did.

Your assistance would be greatly appreciated.

Cheers

Jenny

DimitriM
Level 1
Level 1

Hi Jenny,

Yes, you can sort columns in repeatable subforms using JavaScript.  It is not a simple scripting task though.  We have a working sample of a LCD form that sorts columns at our web site www.pdfscripting.com, but the library of sample scripted files is not a free resource.  Since you say you are new to scripting, in addition to the library of scripted sample files you may find the training videos at the site worth the membership fee.

Hope this helps,

Dimitri Munkirs

WindJack Solutions

www.pdfscripting.com

www.windjack.com