Colgroup Tag |
---|
columnpadding0px |
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
var success = dataset.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
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) |
---|
| 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 | getAsHTMLcreateDataSource-String_Object_StringArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getAsHTMLcreateDataSource |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| getAsHTMLcreateDataSource |
Span |
---|
(name, types, pkNames) |
|
|
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 namesCreate a data source from the data set with specified name and using specified types, add . |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Parameters | Table Cell (td) |
---|
Sample
|
| Table Row (tr) |
---|
| {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'); //gets anote: datasetuse basedregular onjavascript aidentifiers queryso //usefulthey tocan limitbe theused numberin of rowsscripting
ds.addColumn('my_label');
var maxReturnedRowsuri = 10 ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT], ['my_id']);
var queryjsform = '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 Row (tr) |
---|
| Table Cell (td) |
---|
| 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 Row (tr) |
---|
| Table Cell (td) |
---|
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 Row (tr) |
---|
| Table Cell (td) |
---|
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 Row (tr) |
---|
| Table Cell (td) |
---|
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 '.' 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 | getAsHTMLgetAsText-BooleanString_BooleanString_BooleanString_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getAsHTMLgetAsText |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escapecolumn_valuesseparator, escaperow_spacesseparator, multi_line_markup, pretty_indentvalue_delimiter, add_column_names) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html tableformatted text. |
|
|
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 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 false, true column headers names will not be added to the tableas a first row. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String – - String htmlformatted text. |
|
|
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>'.
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) |
---|
id | getAsText-String_String_String_BooleangetColumnName-Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getAsTextgetColumnName |
|
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. | String |
|
|
Table Row (tr) |
---|
| Table Cell (td) | Returns |
---|
Div |
---|
| String – String formatted textGet a column name based on index. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Parameters |
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnAsArray 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 Row (tr) |
---|
| Table Cell (td) |
---|
| Table Body (tbody) |
---|
id | getColumnAsArray-Number |
---|
| {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) |
---|
span Sample |
|
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
| 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) |
---|
id | getColumnName-NumbergetColumnNames |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnNamegetColumnNames |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| getColumnNamegetColumnNames |
|
| 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)Get the column names of a dataset. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String – [] - String[] column name.names |
|
|
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:
|
---|
| Code Block |
---|
| 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.
}
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) |
---|
Returns Div |
---|
| ServoyException – - ServoyException exception or null when not available. |
|
|
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 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
|
|
|
|
|
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
var success = dataset.removeColumn(1); // removes first column
|
|
|
|
|
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');
|
|
|
|
|
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;
}
|
|
|
|
|
|