Child pages
  • JSDataSource

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryCreate a query builder for a data source.Create a query builder for a data source with given table alias.Get the column names of a datasource.Get the datasource string.Returns a foundset object for a specified datasource or server and tablename.An existing foundset under that name will be returned, or created if there is a definition (there is a form with a named foundset property with that name).Get a single record from a datasource.Get the table of a datasource.get a new foundset containing records based on a dataset of pks.get a new foundset containing records based on a QBSelect query.get a new foundset containing records based on an SQL query string.get a new foundset containing records based on an SQL query string with parameters.

functionservoy sDetail2100%height:30px2Methods DetailscreateSelectname

createSelect()

dessIndent
Create a query builder for a data source.
ret

Returns

sIndent query builder
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowcreateSelectname

createSelect(tableAlias)

dessIndent
Create a query builder for a data source with given table alias.
 The alias can be used inside custom queries to bind to the outer table.
prs

Parameters

sIndenttableAliasthe table alias to use
ret

Returns

sIndent query builder
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getColumnNamesname

getColumnNames()

dessIndent
Get the column names of a datasource.
ret

Returns

sIndent String[] column names
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getDataSourcename

getDataSource()

dessIndent
Get the datasource string.
ret

Returns

sIndent String datasource
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getFoundSetname

getFoundSet()

dessIndent
Returns a foundset object for a specified datasource or server and tablename.
It is important to note that this is a FACTORY method, it constantly creates new foundsets.
ret

Returns

sIndent A new JSFoundset for the datasource.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getFoundSetname

getFoundSet(name)

dessIndent
An existing foundset under that name will be returned, or created if there is a definition (there is a form with a named foundset property with that name).
If named foundset datasource does not match current datasource will not be returned (will return null instead).
prs

Parameters

sIndentnameThe named foundset to get for this datasource.
ret

Returns

sIndent An existing named foundset for the datasource.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRecordname

getRecord(pk)

dessIndent
Get a single record from a datasource.
For the sake of performance, if more records are needed,
don't call this method in a loop but try using other methods instead.
prs

Parameters

sIndentpkThe primary key of the record to be retrieved. Can be an array, in case of a composite pk.
ret

Returns

sIndent a record
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getTablename

getTable()

dessIndent
Get the table of a datasource.
ret

Returns

sIndent JSTable table
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
loadRecordsname

loadRecords(dataSet)

dessIndent
get a new foundset containing records based on a dataset of pks.
prs

Parameters

sIndentdataSet ;
ret

Returns

sIndent a new JSFoundset
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
loadRecordsname

loadRecords(qbSelect)

dessIndent
get a new foundset containing records based on a QBSelect query.
prs

Parameters

sIndentqbSelecta query builder object
ret

Returns

sIndent a new JSFoundset
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
loadRecordsname

loadRecords(query)

dessIndent
get a new foundset containing records based on an SQL query string.
prs

Parameters

sIndentqueryan SQL query
ret

Returns

sIndent a new JSFoundset
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
loadRecordsname

loadRecords(query, args)

dessIndent
get a new foundset containing records based on an SQL query string with parameters.
prs

Parameters

sIndentqueryan SQL query string with parameter placeholdersargsan array of arguments for the query string
ret

Returns

sIndent a new JSFoundset
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow