06-16-2011, 04:16 PM
![](wiki/easy-ide-book/common/images/topic.gif)
![](wiki/easy-ide-book/common/images/topic.gif)
To display a table, we need the basic data (RecordSet), as well as the grid (RecordGrid) to be used to display that data. Let’s take a look at the source code:
![](wiki/easy-ide-book/try3/images/figure_3_3.png)
1. Create the data to be displayed: RecordSet
Code:
let data:RecordSet =
{RecordSet
...
}
First, we have to create the data (RecordSet) that is to be displayed in a table (RecordGrid). In a RecordSet, the constituent data is organized into records and fields, allowing a client to manage the data in memory. Thus, a user can perform filtering and sorting on a client machine without having to access a database.
![](wiki/easy-ide-book/try3/images/figure_3_4.png)
Next, let’s take a look at RecordFields and RecordData, which display fields and records, respectively.
2. Specifying fields: RecordFields
Code:
{RecordFields
{RecordField name, domain = String},
{RecordField age, domain = int},
{RecordField score, domain = int}
}
RecordFields contains each instance of a RecordField that makes up a RecordSet. RecordField is used to specify the name and attributes of a field. In this example, the specified character strings like name and age are field names. A name must be specified for each field. This name is referenced whenever data is added or modified. The specification of attributes like domain is optional. Some examples of attributes are given below.
3. Adding data: RecordData
Code:
{RecordData name = Matt, age = 33, score = 88},
{RecordData name = Sarah, age = 27, score = 79},
{RecordData name = Jacob, age = 26, score = 90}
Using RecordData, we can add data to a RecordSet. RecordData is used to specify the data in each field.
4. Displaying data: RecordGrid
Steps (1) to (3) are used to create the data that we refer to as a RecordSet. While a RecordSet specifies data, it has no function for displaying that data on the screen. In Curl, separate APIs are provided to actually display a RecordSet. For example, RecordGrid allows you to easily display a RecordSet in a grid
RecordGrid incorporates multiple functions. Some examples are given below.
Also, right-clicking a cell enables operations such as of data filtering, copying, and pasting.