Currently Being Moderated

Try 3: Page 6

VERSION 1

Created on: Feb 4, 2008 3:47 PM by Curl Education - Last Modified:  Mar 5, 2008 11:25 AM by Curl Education

!../../wiki/easy-ide-book/common/images/prev_page.gif! !../../wiki/easy-ide-book/common/images/toc.gif! !../../wiki/easy-ide-book/common/images/next_page.gif!

 

 

 

<font color="navy">Structure of a Program that Sorts and Filters the Data</font>

 

 

The <font color="purple">RecordGrid</font> data can be sorted and filtered.

 

 

1. Sorting data: sort

 

 

set rg.sort = score DESC

 

 

We can use sort to sort the data displayed by <font color="purple">RecordGrid</font>.  To do so, we specify the names of the fields to be sorted as character strings.  As in this example, when we want to sort the data into descending order, we add DESC after each field name.  We can specify multiple fields by delimiting their names with a comma (,).

 

set rg.sort = score DESC, age DESC

 

 

By using RecordSort, we can specify more complex types of sorting.

 

2. Filtering data: filter

 

 

set rg.filter = {RecordData city = Miami}

 

 

To filter the data to be displayed, we use the filter field. To specify the fields and data to be filtered, we use <font color="purple">RecordData</font>. Using <font color="purple">RecordFilter</font>, we can specify relatively complex filtering. If we specify null, then no filtering is performed.

 

3. Fixing the display region: set-frozen-region

 

 

{rg.set-frozen-region 0,1}

 

 

Using set-frozen-region, we can fix the position of the <font color="purple">RecordGrid</font> window frame. This prevents the scrolling of the specified lines and columns. There are several other APIs for managing fixed lines and columns. These are described in the Curl API documentation.

 

4. Displaying the layout: VBox

 

 

{VBox
    rg,
    {HBox
        sort-button,
        filter-button,
        reverse-button
    }
}

 

 

As explained above, the final expression specified in the value block is displayed on the screen. In the current example, this <font color="purple">VBox</font> is the final expression. Therefore, the screen layout will appear as shown in the figure.

 

 

!../../wiki/easy-ide-book/common/images/next_page.gif!

Average User Rating
(0 ratings)




There are no comments on this document

More Like This

  • Retrieving data ...