Progress
Programming
Handbook


Moving Columns

You can use the MOVE–COLUMN( ) method to rearrange the columns within a browse. For example, rather than forcing the user to scroll horizontally to see additional columns, you might allow them to reorder the columns.

The following example sets up a button that brings the phone column up to the third column position in the browse from the sixth position:

p-br13.p
DEFINE QUERY q1 FOR customer. 
DEFINE BROWSE b1 QUERY q1 DISPLAY cust-num name city 
    state postal-code phone WITH 10 DOWN WIDTH 70 SEPARATORS. 
DEFINE BUTTON b-phone LABEL "Shown Phone Nos.".  
DEFINE VARIABLE method-return AS LOGICAL. 
DEFINE FRAME f1 
   b1 SKIP(.5) 
   b-phone 
        WITH SIDE-LABELS ROW 2 CENTERED NO-BOX. 
ON CHOOSE OF b-phone  
DO: 
    method-return = b1:MOVE-COLUMN(6, 3).  /* Move the phone column up. */ 
    DISABLE b-phone WITH FRAME f1.  
END. 
OPEN QUERY q1 FOR EACH customer. 
ENABLE b1 b-phone WITH FRAME f1. 
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

When you run this procedure, the following browse appears:

If you choose the button, the phone column moves to the third column, bumping the others back by one, as the following screen shows:


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095