Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| adds a column with the specified name to the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - column name. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if succeeded, else false. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var success = dataset.addColumn('columnName',1); |
|
|
|
|
Table Body (tbody) |
---|
id | addColumn-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| adds a column with the specified name to the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - column name. {Number} index - column index number between 1 and getMaxColumnIndex(). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if succeeded, else false. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
|
|
|
|
| //tosettherowIndex:
rowIndex = 1 //sets the rowIndex to the first row (dataset is 1-based)
//to retrieve the rowIndex of the currently selected row
var currRow = dataset.rowIndex
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=99A87B8A-B434-4996-8D66-6BE83EEEE4F7}{tr:id=name}{td}h6.addColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}addColumn{span}{span:id=iets|style=float: left;}\(name, index, type){span}{td}{tr}{tr:id=des}{td}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_des|text=|trigger=button}{sub-section}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_des|trigger=none|class=sIndent}adds a column with the specified name to the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_prs|trigger=none}name -- column name.
\[index\] -- column index number between 1 and getMaxColumnIndex().
\[type\] -- the type of column, see JSColumn constants.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_ret|text=|trigger=button}{sub-section}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_see|text=|trigger=button}{sub-section}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_see|text=|trigger=button}{sub-section}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_sam|text=|trigger=button}{sub-section}{sub-section:99A87B8A-B434-4996-8D66-6BE83EEEE4F7_sam|class=sIndent|trigger=none}{code:language=javascript}
addColumn('columnName',1); |
|
|
|
|
Table Body (tbody) |
---|
id | addColumn-String_Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| adds a column with the specified name to the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - column name. {Number} index - column index number between 1 and getMaxColumnIndex(). {Number} type - the type of column, see JSColumn constants. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if succeeded, else false. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var success = dataset.addColumn('columnName',1); |
|
|
|
|
Table Body (tbody) |
---|
id | addHTMLProperty-Number_Number_String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addHTMLProperty |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(row, col, name, value) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add an HTML property to an HTML tag produced in getAsHTML(). For row and col parameters use: 1 = applies to the container 0 = applies to all >0 = applies to specific cell |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} row - row number {Number} col - column number {String} name - String property name {String} value - String property value |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //adds a container property (to TABLE tag)
dataset.addHTMLProperty(-1,-1,'cellspacing','3');
dataset.addHTMLProperty(-1,-1,'style','border-collapse:collapse;'); //to have a single line border
//adds a row property to all rows (to TR tag)
dataset.addHTMLProperty(0,0,'class','text');
//adds a row property to second row (to TR tag)
dataset.addHTMLProperty(2,0,'class','text');
//adds a column property to all 3rd columns (to TD tag)
dataset.addHTMLProperty(0,3,'class','redcolumn') ;
//adds a specific cell property (to TD tag)
dataset.addHTMLProperty(2,4,'color','blue');
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>'; |
|
|
|
|
Table Body (tbody) |
---|
id | addRow-Number_ObjectArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add a row to the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index to add row (1-based) {Object[]} array - row data |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
|
|
|
|
| var success =dataset.addRow(new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns
dataset. |
|
|
|
| addColumn'columnName',1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1}{tr:id=name}{td}h6.addHTMLProperty{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addHTMLProperty{span}{span:id=iets|style=float: left;}\(row, col, name, value){span}{td}{tr}{tr:id=des}{td}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_des|text=|trigger=button}{sub-section}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_des|trigger=none|class=sIndent}Add an HTML property to an HTML tag produced in getAsHTML().
For row and col parameters use:
1 = applies to the container
0 = applies to all
>0 = applies to specific cell{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_prs|trigger=none}row -- row number
col -- column number
name -- String property name
value -- String property value
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_ret|text=|trigger=button}{sub-section}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_see|text=|trigger=button}{sub-section}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_see|text=|trigger=button}{sub-section}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_sam|text=|trigger=button}{sub-section}{sub-section:4AFEF94F-E908-4B9E-B2D1-FD65FA40FFB1_sam|class=sIndent|trigger=none}{code:language=javascript}
//adds a container property (to TABLE tag)
dataset.addHTMLProperty(-1,-1,'cellspacing','3');
//adds a row property to all rows (to TR tag)
dataset.addHTMLProperty(0,0,'class','text');
//adds a row property to second row (to TR tag)
dataset.addHTMLProperty(2,0,'class','text');
//adds a column property to all 3rd columns (to TD tag)
dataset.addHTMLProperty(0,3,'class','redcolumn') ;
//adds a specific cell property (to TD tag)
dataset.addHTMLProperty(2,4,'color','blue');
globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=16EB033B-4BA8-43CF-A543-4B7F91AE4166}{tr:id=name}{td}h6.addRow{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addRow{span}{span:id=iets|style=float: left;}\(index, array){span}{td}{tr}{tr:id=des}{td}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_des|text=|trigger=button}{sub-section}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_des|trigger=none|class=sIndent}Add a row to the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_prs|trigger=none}\[index\] -- index to add row (1-based), add by default as last row
array -- row data
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_ret|text=|trigger=button}{sub-section}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_see|text=|trigger=button}{sub-section}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_see|text=|trigger=button}{sub-section}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_sam|text=|trigger=button}{sub-section}{sub-section:16EB033B-4BA8-43CF-A543-4B7F91AE4166_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
dataset.addRow(new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns
dataset.addRow(2, new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns after row 2
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=174DD6B2-73D9-4DAC-86FA-441CE658A3AA}{tr:id=name}{td}h6.createDataSource{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}createDataSource{span}{span:id=iets|style=float: left;}\(name, types){span}{td}{tr}{tr:id=des}{td}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_des|text=|trigger=button}{sub-section}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_des|trigger=none|class=sIndent}Create a data source from the data set with specified name and using specified types.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_prs|trigger=none}name -- data source name
\[types\] -- array of types as defined in JSColumn, when null or not supplied types are inferred from the data if possible.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_ret|text=|trigger=button}{sub-section}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_ret|trigger=none|class=sIndent}[String] -- String uri reference to the created data source.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_see|text=|trigger=button}{sub-section}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_see|text=|trigger=button}{sub-section}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_sam|text=|trigger=button}{sub-section}{sub-section:174DD6B2-73D9-4DAC-86FA-441CE658A3AA_sam|class=sIndent|trigger=none}{code:language=javascript}
ds.addColumn('my_id');
ds.addColumn('my_label');
var uri = ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT]);
var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300);
var query = 'select customerid, address, city, country from customers';
var ds2 = databaseManager.getDataSetByQuery('example_data', query, null, 999);
var uri2 = ds2.createDataSource('mydata2'); // types are inferred from query result
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3}{tr:id=name}{td}h6.getAsHTML{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAsHTML{span}{span:id=iets|style=float: left;}\(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names){span}{td}{tr}{tr:id=des}{td}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_des|text=|trigger=button}{sub-section}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_des|trigger=none|class=sIndent}Get the dataset as an html table.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_prs|trigger=none}\[escape_values\] -- if true, replaces illegal HTML characters with corresponding valid escape sequences.
\[escape_spaces\] -- if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.
\[multi_line_markup\] -- if true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>
\[pretty_indent\] -- if true, adds indentation for more readable HTML code.
\[add_column_names\] -- if false, column headers will not be added to the table.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_ret|text=|trigger=button}{sub-section}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_ret|trigger=none|class=sIndent}[String] -- String html.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_see|text=|trigger=button}{sub-section}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_see|text=|trigger=button}{sub-section}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_sam|text=|trigger=button}{sub-section}{sub-section:F49F63D3-918B-4EBF-A6DE-5A3C115DB9D3_sam|class=sIndent|trigger=none}{code:language=javascript}
//gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=48FAB84F-9383-4BA8-83A8-70325BFE8433}{tr:id=name}{td}h6.getAsText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAsText{span}{span:id=iets|style=float: left;}\(column_separator, row_separator, value_delimiter, add_column_names){span}{td}{tr}{tr:id=des}{td}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_des|text=|trigger=button}{sub-section}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_des|trigger=none|class=sIndent}Get the dataset as formatted text.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_prs|trigger=none}column_separator -- any specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' .
row_separator -- the specified row separator; examples: new line '\n'.
value_delimiter -- the specified value delimiter; example: double quote '"'.
add_column_names -- boolean if true column names will be added as a first row.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_ret|text=|trigger=button}{sub-section}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_ret|trigger=none|class=sIndent}[String] -- String formatted text.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_see|text=|trigger=button}{sub-section}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_see|text=|trigger=button}{sub-section}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_sam|text=|trigger=button}{sub-section}{sub-section:48FAB84F-9383-4BA8-83A8-70325BFE8433_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
//you can create csv or tab delimited results
var csv = dataset.getAsText(',','\n','"',true)
var tab = dataset.getAsText('\t','\n','"',true)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8}{tr:id=name}{td}h6.getColumnAsArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnAsArray{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_des|text=|trigger=button}{sub-section}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_des|trigger=none|class=sIndent}Get the column data of a dataset as an Array.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_prs|trigger=none}index -- index of column (1-based).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_ret|text=|trigger=button}{sub-section}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_ret|trigger=none|class=sIndent}Object[] -- Object array of data.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_see|text=|trigger=button}{sub-section}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_see|text=|trigger=button}{sub-section}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_sam|text=|trigger=button}{sub-section}{sub-section:D8818DA7-DFD5-4BDE-9DFF-BD2EFB19F9F8_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dataArray = dataset.getColumnAsArray(1); //puts the contents from the first column of the dataset into an array
//once you have it as an array you can loop through it or feed it to a custom valuelist for example
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D4F9B3F8-2363-43C0-8997-F1554684D107}{tr:id=name}{td}h6.getColumnName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnName{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_des|text=|trigger=button}{sub-section}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_des|trigger=none|class=sIndent}Get a column name based on index.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_prs|trigger=none}index -- index of column (1-based).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_ret|text=|trigger=button}{sub-section}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_ret|trigger=none|class=sIndent}[String] -- String column name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_see|text=|trigger=button}{sub-section}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_see|text=|trigger=button}{sub-section}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_sam|text=|trigger=button}{sub-section}{sub-section:D4F9B3F8-2363-43C0-8997-F1554684D107_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var firstColumName = dataset.getColumnName(1) //retrieves the first columnname into the variable firstColumName
//using a loop you can get all columnames in an array:
var query = 'select * from customers';
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 100);
var colArray = new Array()
for (var i = 1; i <= dataset.getMaxColumnIndex(); i++)
{
colArray[i-1] = dataset.getColumnName(i)
//note the -1, because an array is zero based and dataset is 1 based.
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=80587DB2-51B5-47D3-906F-19DFF6629AD5}{tr:id=name}{td}h6.getException{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[ServoyException]{span}{span:id=iets|style=float: left; font-weight: bold;}getException{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_des|text=|trigger=button}{sub-section}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_des|trigger=none|class=sIndent}Get the database exception if an error occurred.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_ret|text=|trigger=button}{sub-section}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_ret|trigger=none|class=sIndent}[ServoyException] -- ServoyException exception or null when not available.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_see|text=|trigger=button}{sub-section}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_see|text=|trigger=button}{sub-section}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_sam|text=|trigger=button}{sub-section}{sub-section:80587DB2-51B5-47D3-906F-19DFF6629AD5_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dbException = dataset.getException();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=FC2F31D9-0799-4763-B16D-5594CDE68EEF}{tr:id=name}{td}h6.getMaxColumnIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMaxColumnIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_des|text=|trigger=button}{sub-section}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_des|trigger=none|class=sIndent}Get the number of columns in the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_ret|text=|trigger=button}{sub-section}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_ret|trigger=none|class=sIndent}[Number] -- int number of columns.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_see|text=|trigger=button}{sub-section}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_see|text=|trigger=button}{sub-section}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_sam|text=|trigger=button}{sub-section}{sub-section:FC2F31D9-0799-4763-B16D-5594CDE68EEF_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
for (var i = 1; i <= dataset.getMaxColumnIndex(); i++)
{
colArray[i-1] = dataset.getColumnName(i)
//have to subtract 1, because an array is zero based and a dataset is 1 based.
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CCF04F40-E9EC-4150-9EE2-767812B7A66A}{tr:id=name}{td}h6.getMaxRowIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMaxRowIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_des|text=|trigger=button}{sub-section}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_des|trigger=none|class=sIndent}Get the number of rows in the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_ret|text=|trigger=button}{sub-section}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_ret|trigger=none|class=sIndent}[Number] -- int number of rows.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_see|text=|trigger=button}{sub-section}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_see|text=|trigger=button}{sub-section}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_sam|text=|trigger=button}{sub-section}{sub-section:CCF04F40-E9EC-4150-9EE2-767812B7A66A_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var totalRows = dataset.getMaxRowIndex();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F34A74A3-6F95-4B3E-BE00-2401101CF8A8}{tr:id=name}{td}h6.getRowAsArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRowAsArray{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_des|text=|trigger=button}{sub-section}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_des|trigger=none|class=sIndent}Get the row data of a dataset as an Array.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_prs|trigger=none}index -- index of row (1-based).
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_ret|text=|trigger=button}{sub-section}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_ret|trigger=none|class=sIndent}Object[] -- Object array of data.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_see|text=|trigger=button}{sub-section}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_see|text=|trigger=button}{sub-section}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_sam|text=|trigger=button}{sub-section}{sub-section:F34A74A3-6F95-4B3E-BE00-2401101CF8A8_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dataArray = dataset.getRowAsArray(1); //puts the contents from the first row of the dataset into an array
//once you have it as an array you can loop through it
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=942EE04C-BF07-4362-B652-D1A20ED49903}{tr:id=name}{td}h6.getValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}getValue{span}{span:id=iets|style=float: left;}\(row, col){span}{td}{tr}{tr:id=des}{td}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_des|text=|trigger=button}{sub-section}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_des|trigger=none|class=sIndent}Get the value specified by row and column position from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_prs|trigger=none}row -- row number, 1-based
col -- column number, 1-based
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_ret|text=|trigger=button}{sub-section}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_ret|trigger=none|class=sIndent}Object -- Object value{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_see|text=|trigger=button}{sub-section}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_see|text=|trigger=button}{sub-section}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_sam|text=|trigger=button}{sub-section}{sub-section:942EE04C-BF07-4362-B652-D1A20ED49903_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
var dataAtRow2Col1 = dataset.getValue(2, 1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=47D82E19-C274-4C44-B5EB-36302C4F00BB}{tr:id=name}{td}h6.hadMoreData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}hadMoreData{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_des|text=|trigger=button}{sub-section}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_des|trigger=none|class=sIndent}Return true if there is more data in the resultset then specified by maxReturnedRows at query time.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_ret|text=|trigger=button}{sub-section}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_ret|trigger=none|class=sIndent}[Boolean] -- boolean more data available{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_see|text=|trigger=button}{sub-section}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_see|text=|trigger=button}{sub-section}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_sam|text=|trigger=button}{sub-section}{sub-section:47D82E19-C274-4C44-B5EB-36302C4F00BB_sam|class=sIndent|trigger=none}{code:language=javascript}
var ds = databaseManager.getDataSetByQuery('example_data', 'select order_id from orders', null, 10000)
if (ds.hadMoreData())
{
// handle large result
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1E9A9034-497A-46D9-A752-9FAF9E3AC10F}{tr:id=name}{td}h6.removeColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}removeColumn{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_des|text=|trigger=button}{sub-section}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_des|trigger=none|class=sIndent}Remove a column by index from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_prs|trigger=none}index -- index of column to remove (1-based)
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_ret|text=|trigger=button}{sub-section}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_see|text=|trigger=button}{sub-section}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_see|text=|trigger=button}{sub-section}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_sam|text=|trigger=button}{sub-section}{sub-section:1E9A9034-497A-46D9-A752-9FAF9E3AC10F_sam|class=sIndent|trigger=none}{code:language=javascript}
2, new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns at row 2 |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Add a row to the dataset. The row will be added as the last row. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Object[]} array - row data |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
dataset.addRow(new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns
dataset.addRow(2, new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns at row 2 |
|
|
|
|
Table Body (tbody) |
---|
id | createDataSource-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Create a data source from the data set with specified name and using specified types. The types are inferred from the data if possible. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - data source name |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - String uri reference to the created data source. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| ds.addColumn('my_id'); // note: use regular javascript identifiers so they can be used in scripting
ds.addColumn('my_label');
var uri = ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT]);
var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300);
var query = 'select customerid, address, city, country from customers';
var ds2 = databaseManager.getDataSetByQuery('example_data', query, null, 999);
var uri2 = ds2.createDataSource('mydata2'); // types are inferred from query result |
|
|
|
|
Table Body (tbody) |
---|
id | createDataSource-String_Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Create a data source from the data set with specified name and using specified types. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - data source name {Object} types - array of types as defined in JSColumn |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - String uri reference to the created data source. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| ds.addColumn('my_id'); // note: use regular javascript identifiers so they can be used in scripting
ds.addColumn('my_label');
var uri = ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT]);
var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300);
var query = 'select customerid, address, city, country from customers';
var ds2 = databaseManager.getDataSetByQuery('example_data', query, null, 999);
var uri2 = ds2.createDataSource('mydata2'); // types are inferred from query result |
|
|
|
|
Table Body (tbody) |
---|
id | createDataSource-String_Object_StringArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(name, types, pkNames) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Create a data source from the data set with specified name and using specified types, add . |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} name - data source name {Object} types - array of types as defined in JSColumn, when null types are inferred from the query result {String[]} pkNames - array of pk names, when null a hidden pk-column will be added |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - String uri reference to the created data source. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| ds.addColumn('my_id'); // note: use regular javascript identifiers so they can be used in scripting
ds.addColumn('my_label');
var uri = ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT], ['my_id']);
var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300);
var query = 'select customerid, address, city, country from customers';
var ds2 = databaseManager.getDataSetByQuery('example_data', query, null, 999);
var uri2 = ds2.createDataSource('mydata2', null, ['customerid']); // types are inferred from query result, use customerid as pk |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, do not escape values or spaces, no multi_line_markup, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, do not escape spaces, no multi_line_markup, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, no multi_line_markup, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces, multi_line_markup) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. {Boolean} multi_line_markup - if true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p> |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces, multi_line_markup, pretty_indent) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. {Boolean} multi_line_markup - if true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p> {Boolean} pretty_indent - if true, adds indentation for more readable HTML code. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean_Boolean_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. {Boolean} multi_line_markup - if true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p> {Boolean} pretty_indent - if true, adds indentation for more readable HTML code. {Boolean} add_column_names - if false, column headers will not be added to the table. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //gets a dataset based on a query
//useful to limit the number of rows
var maxReturnedRows = 10;
var query = 'select c1,c2,c3 from test_table where start_date = ?';
//to access data by name, do not use '.' or special characters in names or aliases
var args = new Array();
args[0] = order_date //or new Date();
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,args,maxReturnedRows);
// gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names
var htmlTable = dataset.getAsHTML(true, true, false, true, true);
//assigns the dataset to a field and sets the display type to HTML_AREA
//assuming the html_field is a global text variable
scopes.globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
//Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsText-String_String_String_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(column_separator, row_separator, value_delimiter, add_column_names) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as formatted text. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} column_separator - any specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' . {String} row_separator - the specified row separator; examples: new line '\n'. {String} value_delimiter - the specified value delimiter; example: double quote '"'. {Boolean} add_column_names - if true column names will be added as a first row. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - String formatted text. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
//you can create csv or tab delimited results
var csv = dataset.getAsText(',','\n','"',true)
var tab = dataset.getAsText('\t','\n','"',true) |
|
|
|
|
Table Body (tbody) |
---|
id | getColumnAsArray-Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnAsArray |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the column data of a dataset as an Array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index of column (1-based). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Object[] - Object array of data. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var dataArray = dataset.getColumnAsArray(1); //puts the contents from the first column of the dataset into an array
//once you have it as an array you can loop through it or feed it to a custom valuelist for example |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a column name based on index. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index of column (1-based). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - String column name. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var firstColumName = dataset.getColumnName(1) //retrieves the first columnname into the variable firstColumName
//using a loop you can get all columnames in an array:
var query = 'select * from customers';
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 100);
var colArray = new Array()
for (var i = 1; i <= dataset.getMaxColumnIndex(); i++)
{
colArray[i-1] = dataset.getColumnName(i)
//note the -1, because an array is zero based and dataset is 1 based.
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnNames |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the column names of a dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String[] - String[] column names |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var query = 'select * from customers';
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, 100);
var columnNames = dataset.getColumnNames(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnType |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get a column type based on index. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index of column (1-based). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - Number the column type (JSColumn constant) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var firstColumnType = dataset.getColumnType(1) //retrieves the first column's type into the variable firstColumnType
if (firstColumnType == JSColumn.NUMBER) { } |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getException |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the database exception if an error occurred. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var dbException = dataset.getException(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getMaxColumnIndex |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the number of columns in the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - int number of columns. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
for (var i = 1; i <= dataset.getMaxColumnIndex(); i++)
{
colArray[i-1] = dataset.getColumnName(i)
//have to subtract 1, because an array is zero based and a dataset is 1 based.
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getMaxRowIndex |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the number of rows in the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - int number of rows. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var totalRows = dataset.getMaxRowIndex(); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getRowAsArray |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the row data of a dataset as an Array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index of row (1-based). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Object[] - Object array of data. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var |
|
|
|
| successremoveColumn removes first column
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=40ED56DD-AEDA-40E7-9D82-EEE6BC876A06}{tr:id=name}{td}h6.removeRow{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeRow{span}{span:id=iets|style=float: left;}\(row){span}{td}{tr}{tr:id=des}{td}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_des|text=|trigger=button}{sub-section}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_des|trigger=none|class=sIndent}Remove a row from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_prs|trigger=none}row -- row index to remove, -1 for all rows
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_ret|text=|trigger=button}{sub-section}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_see|text=|trigger=button}{sub-section}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_see|text=|trigger=button}{sub-section}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_sam|text=|trigger=button}{sub-section}{sub-section:40ED56DD-AEDA-40E7-9D82-EEE6BC876A06_sam|class=sIndent|trigger=none}{code:language=javascript}
puts the contents from the first row of the dataset into an array
//once you have it as an array you can loop through it |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the value specified by row and column position from the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} row - row number, 1-based {Number} col - column number, 1-based |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
var dataAtRow2Col1 = dataset.getValue(2, 1); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
hadMoreData |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Return true if there is more data in the resultset then specified by maxReturnedRows at query time. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - boolean more data available |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var ds = databaseManager.getDataSetByQuery('example_data', 'select order_id from orders', null, 10000)
if (ds.hadMoreData())
{
// handle large result
} |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
removeColumn |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Remove a column by index from the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index of column to remove (1-based) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if succeeded, else false. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
|
|
|
|
| dataset.removeRow(1); //removes the first row
dataset.removeRow(-var success = dataset.removeColumn(1); // removes |
|
|
|
| all rows
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=922B9FEB-5AFD-47E5-9562-C1FECCFA285B}{tr:id=name}{td}h6.setValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setValue{span}{span:id=iets|style=float: left;}\(row, col, obj){span}{td}{tr}{tr:id=des}{td}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_des|text=|trigger=button}{sub-section}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_des|trigger=none|class=sIndent}Set the value specified by row and column position from the dataset.
Use row = -1, to set columnnames.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_prs|trigger=none}row -- row number, 1-based
col -- column number, 1-based
obj -- the value to be stored at the given row and column.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_ret|text=|trigger=button}{sub-section}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_see|text=|trigger=button}{sub-section}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_see|text=|trigger=button}{sub-section}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_sam|text=|trigger=button}{sub-section}{sub-section:922B9FEB-5AFD-47E5-9562-C1FECCFA285B_sam|class=sIndent|trigger=none}{code:language=javascript}
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Remove a row from the dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} row - row index to remove, -1 for all rows |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
dataset.removeRow(1); //removes the first row
dataset.removeRow(-1); //removes all rows |
|
|
|
|
Table Body (tbody) |
---|
id | setColumnName-Number_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
setColumnName |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Set a column name based on index. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} index - index of column (1-based). {String} columnName - new column name. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var query = 'select customerid, customername from customers';
var dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()), query, null, -1);
dataset.setColumnName(2, 'name_of_customer') // change the column name for second column. |
|
|
|
|
Table Body (tbody) |
---|
id | setValue-Number_Number_Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Set the value specified by row and column position from the dataset. Use row = -1, to set columnnames. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} row - row number, 1-based {Number} col - column number, 1-based {Object} obj - the value to be stored at the given row and column. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //assuming the variable dataset contains a dataset
dataset.getValue(2, 1,'data') |
|
|
|
| ;
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F4CF9FA6-A6C0-4B83-A030-9288E9B689E2}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}sort{span}{span:id=iets|style=float: left;}\(col, sort_direction){span}{td}{tr}{tr:id=des}{td}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_des|text=|trigger=button}{sub-section}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_des|trigger=none|class=sIndent}Sort the dataset on the given column in ascending or descending.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_prs|trigger=none}col -- column number, 1-based
sort_direction -- boolean true for ascending, false for descending
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_ret|text=|trigger=button}{sub-section}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_see|text=|trigger=button}{sub-section}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_see|text=|trigger=button}{sub-section}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_sam|text=|trigger=button}{sub-section}{sub-section:F4CF9FA6-A6C0-4B83-A030-9288E9B689E2_sam|class=sIndent|trigger=none}{code:language=javascript}
//assuming the variable dataset contains a dataset
dataset.sort(1,false)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(col, sort_direction) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sort the dataset on the given column (1-based) in ascending or descending. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} col - column number, 1-based {Boolean} sort_direction - ascending (true) or descending (false) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // sort using column number
//assuming the variable dataset contains a dataset
dataset.sort(1, false) |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Sort the dataset using the function as comparator. The comparator function is called to compare two rows, that are passed as arguments, and it will return -1/0/1 if the first row is less/equal/greater then the second row. NOTE: starting with 7.2 release, when called on datasource(foundset) dataset, this function doesn't save the data anymore |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Function} comparator - comparator function |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //sort using comparator
dataset.sort(mySortFunction);
function mySortFunction(r1, r2)
{
var o = 0;
if(r1[0] < r2[0])
{
o = -1;
}
else if(r1[0] > r2[0])
{
o = 1;
}
return o;
} |
|
|
|
|
|