Child pages
  • QBSorts

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
QBSelect
Table Cell (td)parent
styleindexdisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
idclass

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet query builder parent table clause, this may be a query or a join clause. Table Row (tr)

Table Cell (td)
QBSelect
Table Cell (td)root
Get query builder parent. HTML Table

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)styleservoy sSummaryid Table Row (tr)
Table Cell (td)
QBSorts
Table Cell (td)add(columnSortAsc)
12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
QBSorts
Table Cell (td)add(functionSortAsc)
3Methods SummaryAd an ascending sorting on a column to the query sort.Ad an ascending sorting on a column to the query sort. Table Row (tr)
Table Cell (td)
QBSorts
Table Cell (td)add(sort)
Table Row (tr)
Table Cell (td)
QBSorts
Table Cell (td)addPk()
Ad a sorting on a column to the query sort.Add the tables' primary pk columns in alphabetical order to the query sort. Table Row (tr)
Table Cell (td)
QBSorts
Table Cell (td)clear()
Clear the sorting clause for the query.

HTML Table

propertyclass Colgroup Tag Colcolspanservoy sDetail2width100%

Col
Table Head (thead) Table Row (tr)styleheight:30px; Table Head (th)colspan2Property Details Table Body (tbody)ididparent Table Row (tr)name

Table Cell (td)id

parent

Table Row (tr)des Table Cell (td) DivclasssIndent
Get query builder parent table clause, this may be a query or a join clause.
Table Row (tr)idtd
ret

Returns

divsIndentclients

classid

Supported Clients

sIndent
QBSelect Table Row (tr)SmartClient,WebClient,NGClientsam

Table Cell (td)

Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idadd-QBColumn
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSorts
Span
stylefont-weight: bold;
add
Span
(columnSortAsc)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Ad an ascending sorting on a column to the query sort.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBColumn} columnSortAsc - column to sort by
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSorts
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.sort.add(query.columns.orderid)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBFunction
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSorts
Span
stylefont-weight: bold;
add
Span
(functionSortAsc)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Ad an ascending sorting on a column to the query sort.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBFunction} functionSortAsc - function to add
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSorts
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.sort.add(query.columns.orderid)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idadd-QBSort
Table Row (tr)
idname
Table Cell (td)

add

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSorts
Span
stylefont-weight: bold;
add
Span
(sort)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Ad a sorting on a column to the query sort.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{QBSort} sort - the sort to add
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSorts
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.sort.add(query.columns.orderid.desc)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idaddPk
Table Row (tr)
idname
Table Cell (td)

addPk

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSorts
Span
stylefont-weight: bold;
addPk
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add the tables' primary pk columns in alphabetical order to the query sort.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSorts
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.sort.addPk()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idclear
Table Row (tr)
idname
Table Cell (td)

clear

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBSorts
Span
stylefont-weight: bold;
clear
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Clear the sorting clause for the query.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSorts
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
query.sort.clear()
Table Row (tr)
classlastDetailRow
Table Cell (td) 

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/person>} */
	var query = databaseManager.createSelect('db:/example_data/person')
	query.where.add(query.joins.person_to_parent.joins.person_to_parent.columns.name.eq('john'))
	foundset.loadRecords(query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idroot
Table Row (tr)
idname
Table Cell (td)

root

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get query builder parent.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
QBSelect
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/order_details>} */
	var subquery = databaseManager.createSelect('db:/example_data/order_details')

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
	query.where.add(query
		.or
			.add(query.columns.order_id.not.isin([1, 2, 3]))

			.add(query.exists(
					subquery.where.add(subquery.columns.orderid.eq(query.columns.order_id)).root
			))
		)

	foundset.loadRecords(query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idfunction
classservoy sDetail
sIdentjavascriptlastDetailRowrootname

root

dessIndent
Get query builder parent.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsaddname

add(columnSortAsc)

dessIndent
Ad an ascending sorting on a column to the query sort.
prs

Parameters

sIndentcolumnSortAsccolumn to sort by
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(functionSortAsc)

dessIndent
Ad an ascending sorting on a column to the query sort.
prs

Parameters

sIndentfunctionSortAscfunction to add
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addname

add(sort)

dessIndent
Ad a sorting on a column to the query sort.
prs

Parameters

sIndentsortthe sort to add
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addPkname

addPk()

dessIndent
Add the tables' primary pk columns in alphabetical order to the query sort.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
clearname

clear()

dessIndent
Clear the sorting clause for the query.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow