Schultz’s PowerBuilder Notes

PFC DataWindow Sort Service


The sort service provides enhanced datawindow sorting capabilities, including an
end -user interface. It includes the following features:

  • Choose to sort on display values vs data values for columns using code tables
  • Sort data by a specific column when the user clicks on a column header
  • Display one of four pre-built sort dialog boxes
  • Choose columns to be excluded from the sort dialogs

How do I turn on the Sort functionality which is triggered by the menu?

To enable the menu sort functionality, the DataWindow must have its Sort service enabled. This is typically done in the Constructor event.

This.of_setSort(True)

How do I sort by column headers?

//DataWindow Control Constructor event
this.of_SetSort(True) 
this.inv_sort.of_SetStyle(3) 
this.inv_sort.of_SetColumnHeader(True)

What are the values for of_SetStyle?

  • DEFAULT or 0 PowerBuilder Sort dialog box (default)¨
  • DRAGDROP or 1 W_sortdragdrop dialog box¨
  • SIMPLE or 2 W_sortsingle dialog box¨
  • DROPDOWNLISTBOX or 3 W_sortmulti dialog box

How do I sort on column display values instead of column id?

this.inv_sort.of_SetUseDisplay(True)

Specifies whether PFC sorts on display values or data values, for columns that display using a code table.

PowerBuilder Sort dialog box always uses data values The PowerBuilder Sort dialog box always uses data values for sorting.

How do I get the sort string?

Ls_sort = dw_1.inv_sort.of_GetSort()

Advertisements

July 10, 2008 - Posted by | 3. PFC, Datawindow Services | , , , , , , ,

1 Comment »

  1. Thanks..it worked…
    datawindow sort was not working, then i tried this method..it worked…

    Comment by Manitha | June 23, 2009 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: