Thread Rating:
  • 333 Vote(s) - 2.76 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page 2: Structure of a Program that Displays a Table in a Grid
06-16-2011, 04:16 PM, (This post was last modified: 06-23-2011, 04:09 PM by ashimo.)
#1
Page 2: Structure of a Program that Displays a Table in a Grid
Structure of a Program that Displays a Table in a Grid

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:


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.


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.


Attached Files
.png   3-1.PNG (Size: 14.24 KB / Downloads: 583)
.png   3-2.PNG (Size: 9.42 KB / Downloads: 599)
Reply


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 6: Structure of a Program that Sorts and Filters the Data ashimo 0 3,281 06-16-2011, 04:32 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
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('56')