Thread Rating:
  • 417 Vote(s) - 2.88 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page 6: Structure of a Program that Sorts and Filters the Data
06-16-2011, 04:32 PM, (This post was last modified: 06-23-2011, 04:13 PM by ashimo.)
#1
Page 6: Structure of a Program that Sorts and Filters the Data
Structure of a Program that Sorts and Filters the Data

The RecordGrid data can be sorted and filtered.


1. Sorting data: sort

Code:
set rg.sort = score DESC

We can use sort to sort the data displayed by RecordGrid. 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 (,).

Code:
set rg.sort = score DESC, age DESC

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

2. Filtering data: filter

Code:
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 RecordData. Using RecordFilter, we can specify relatively complex filtering. If we specify null, then no filtering is performed.

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

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

Using set-frozen-region, we can fix the position of the RecordGrid 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

Code:
{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 VBox is the final expression. Therefore, the screen layout will appear as shown in the figure.





Possibly Related Threads...
Thread Author Replies Views Last Post
  Page 1: Displaying Data in a Grid ashimo 2 6,559 08-25-2011, 09:55 AM
Last Post: ashimo
  Page 8: Extra Practice ashimo 0 3,355 06-16-2011, 04:39 PM
Last Post: ashimo
  Page 7: Summary ashimo 0 3,177 06-16-2011, 04:37 PM
Last Post: ashimo
  Page 5: Sorting and Filtering Data ashimo 0 3,794 06-16-2011, 04:27 PM
Last Post: ashimo
  Page 4: Structure of a Program for Setting the RecordGrid's Appearance and Functiona ashimo 0 3,702 06-16-2011, 04:24 PM
Last Post: ashimo
  Page 3: Using Options to Modify the RecordGrid Appearance and Functionality ashimo 0 3,781 06-16-2011, 04:20 PM
Last Post: ashimo
  Page 2: Structure of a Program that Displays a Table in a Grid ashimo 0 3,230 06-16-2011, 04:16 PM
Last Post: ashimo
Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('60')