Skip to content

CreateDataSource - cCJGrid

Creates and returns a datasource object to be used with this grid. Is called when the object is created.

Type: Function
Return Data Type: Handle

Syntax

Function CreateDataSource Returns Handle

Call Example

Get CreateDataSource to HandleVariable

Description

CreateDataSource is called by the grid's constructor to create a datasource object and returns its handle. The constructor then assigns this to phoDataSource. This provides a way for a grid object or, more likely, a grid subclass to use a custom datasource.

The cCJGrid class uses a cCJGridDataSource datasource object, which is created as follows:

Function CreateDataSource Returns Handle
    Handle hoDataSource
    Get Create (RefClass(cCJGridDataSource)) to hoDataSource
    Function_Return hoDataSource
End_Function

The cDbCJGrid class uses a cDbCJGridDataSource datasource object, which is created as follows:

Function CreateDataSource Returns Handle
    Handle hoDataSource
    Get Create (RefClass(cDbCJGridDataSource)) to hoDataSource
    Function_Return hoDataSource
End_Function

The creation of custom datasource objects is considered to be an advanced technique. We expect this function will rarely be augmented.

This message can only be augmented in subclasses. If added to an object, it will not be called when the object is created.

Return Value

Returns a handle to datasource object to be used with this grid.