Planet PDF Forum Archive

Planet PDF  ForumThe page you are viewing is part of our 160,000 page discussion forum archive. See below for PDF-related discussions spanning 1999-2008. To ask questions and get help, head to the live Planet PDF Forum.


How to search this archive. The quickest way is to use the filters on our Advanced Search page so that only archive pages are included in the results.


Previous | Next | (P-PDF) JavaScript


Topic: Sort in Combo does not Sort
Conf: (P-PDF) JavaScript, Msg: 28223
From: george
Date: 10/6/2001 06:08 AM

> I fear that you'll tell me to go buy a reference
> book,

Good idea!

> but how would I programmatically sort the
> list? I've search several Java Guide(s) and there
> is no reference to it.

You might consider placing the items in a JavaScript array, and using the "sort" method of the array to sort it. Another advantage to using an array from the beginning is you can then use "setItems" using the array, instead of "insertItemAt". Things will be a bit more complicated if you want to include export values for the list items as well, but it can be done.

Here's some simple code that might get you started:

var f = getField("combo1");

var a1 = new Array();
a1[0] = "Lagavulin";
a1[1] = "Laphroaig";
a1[2] = "Ardbeg";
a1[3] = "Bowmore";

a1.sort();

f.setItems(a1);



Man, I need a drink. :^)

George

PDF In-Depth Free Product Trials Ubiquitous PDF

Pitstop Pro

Now graphic arts professionals have even broader and more expert control over their PDF documents. With...

Download free demo

ARTS PDF Aerialist

The ultimate plug-in for Adobe Acrobat and #1 selling product at PDF Store. Advanced splitting, merging,...

Download free demo

Ubiquitous PDF: 2009 IRS income tax forms available for download

With less than a month to go until Americans will be scrambling to file their 2009 tax paperwork. Luckily, printable PDF versions of forms such as the 1040 can be downloaded for free from the IRS website.

March 18, 2010
Search Planet PDF
more searching options...







Download PDF Creator

PDF Resources
Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools QuickPDF: The Unrivaled PDF Developer Toolkit

Get Nitro PDF Professional
Featured Product

NITRO PDF Professional

Built from the ground up, the perfect desktop PDF product for business and enterprise. Nitro PDF Professional has an uncompromising feature set so you can create, combine, edit, collaborate on and...

Featured Event

No upcoming events

PDF Store Categories