Child pages
  • JSDataSet

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Hidden
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE


HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#rowIndex
Get or set the record index of the dataset.

HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#addColumn(name, [index], [type])
adds a column with the specified name to the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addHTMLProperty(row, col, name, value)
Add an HTML property to an HTML tag produced in getAsHTML().
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addRow(index, array)
Add a row to the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#addRow(array)
Add a row to the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#createDataSource(name)
Create a data source from the data set with specified name and using specified types.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#createDataSource(name, types)
Create a data source from the data set with specified name and using specified types.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getAsHTML([escape_values], [escape_spaces], [multi_line_markup], [pretty_indent], [add_column_names])
Get the dataset as an html table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getAsText(column_separator, row_separator, value_delimiter, add_column_names)
Get the dataset as formatted text.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
#getColumnAsArray(index)
Get the column data of a dataset as an Array.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getColumnName(index)
Get a column name based on index.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
ServoyException
Table Cell (td)
#getException()
Get the database exception if an error occurred.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getMaxColumnIndex()
Get the number of columns in the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getMaxRowIndex()
Get the number of rows in the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
#getRowAsArray(index)
Get the row data of a dataset as an Array.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
#getValue(row, col)
Get the value specified by row and column position from the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hadMoreData()
Return true if there is more data in the resultset then specified by maxReturnedRows at query time.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#removeColumn(index)
Remove a column by index from the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#removeRow(row)
Remove a row from the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#setValue(row, col, obj)
Set the value specified by row and column position from the dataset.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#sort(col, sort_direction)
Sort the dataset on the given column in ascending or descending.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#sort(rowComparator)
Sort the dataset using a comparator function.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idrowIndex
classnode
Table Row (tr)
idname
Table Cell (td)
rowIndex
Table Row (tr)
iddes
Table Cell (td)
Get or set the record index of the dataset.
Table Row (tr)
idret
Table Cell (td)
Returns
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
//to set the rowIndex:
dataset.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
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idaddColumn
classnode
Table Row (tr)
idname
Table Cell (td)
addColumn
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
addColumn
Span
stylefloat: left;
idiets
(name, [index], [type])
Table Row (tr)
iddes
Table Cell (td)
adds a column with the specified name to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
name – column name.
[index] – column index number between 1 and getMaxColumnIndex().
[type] – the type of column, see JSColumn constants.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if succeeded, else false.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
var success = dataset.addColumn('columnName',1);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddHTMLProperty
classnode
Table Row (tr)
idname
Table Cell (td)
addHTMLProperty
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addHTMLProperty
Span
stylefloat: left;
idiets
(row, col, name, value)
Table Row (tr)
iddes
Table Cell (td)

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)
idprs
Table Cell (td)
Parameters
{Number} row – row number
{Number} col – column number
{String} name – String property name
{String} value – String property value
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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');

globals.html_field = '<html>'+dataset.getAsHTML()+'</html>';
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddRow-Number_
classnode
Table Row (tr)
idname
Table Cell (td)
addRow
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addRow
Span
stylefloat: left;
idiets
(index, array)
Table Row (tr)
iddes
Table Cell (td)
Add a row to the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} index – index to add row (1-based)
{Object[]} array – row data
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idaddRow-
classnode
Table Row (tr)
idname
Table Cell (td)
addRow
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
addRow
Span
stylefloat: left;
idiets
(array)
Table Row (tr)
iddes
Table Cell (td)
Add a row to the dataset. The row will be added as the last row.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Object[]} array – row data
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSource-String
classnode
Table Row (tr)
idname
Table Cell (td)
createDataSource
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
createDataSource
Span
stylefloat: left;
idiets
(name)
Table Row (tr)
iddes
Table Cell (td)
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)
idprs
Table Cell (td)
Parameters
{String} name – data source name
Table Row (tr)
idret
Table Cell (td)
Returns
String – String uri reference to the created data source.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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 Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateDataSource-String_Object
classnode
Table Row (tr)
idname
Table Cell (td)
createDataSource
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
createDataSource
Span
stylefloat: left;
idiets
(name, types)
Table Row (tr)
iddes
Table Cell (td)
Create a data source from the data set with specified name and using specified types.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} name – data source name
{Object} types – array of types as defined in JSColumn
Table Row (tr)
idret
Table Cell (td)
Returns
String – String uri reference to the created data source.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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 Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetAsHTML
classnode
Table Row (tr)
idname
Table Cell (td)
getAsHTML
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getAsHTML
Span
stylefloat: left;
idiets
([escape_values], [escape_spaces], [multi_line_markup], [pretty_indent], [add_column_names])
Table Row (tr)
iddes
Table Cell (td)
Get the dataset as an html table.
Table Row (tr)
idprs
Table Cell (td)
Parameters
[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.
Table Row (tr)
idret
Table Cell (td)
Returns
String – String html.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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
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)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetAsText
classnode
Table Row (tr)
idname
Table Cell (td)
getAsText
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getAsText
Span
stylefloat: left;
idiets
(column_separator, row_separator, value_delimiter, add_column_names)
Table Row (tr)
iddes
Table Cell (td)
Get the dataset as formatted text.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{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)
idret
Table Cell (td)
Returns
String – String formatted text.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetColumnAsArray
classnode
Table Row (tr)
idname
Table Cell (td)
getColumnAsArray
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object[]
Span
stylefloat: left; font-weight: bold;
idiets
getColumnAsArray
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get the column data of a dataset as an Array.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} index – index of column (1-based).
Table Row (tr)
idret
Table Cell (td)
Returns
Object[] – Object array of data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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 Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetColumnName
classnode
Table Row (tr)
idname
Table Cell (td)
getColumnName
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getColumnName
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get a column name based on index.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} index – index of column (1-based).
Table Row (tr)
idret
Table Cell (td)
Returns
String – String column name.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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 Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetException
classnode
Table Row (tr)
idname
Table Cell (td)
getException
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
ServoyException
Span
stylefloat: left; font-weight: bold;
idiets
getException
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get the database exception if an error occurred.
Table Row (tr)
idret
Table Cell (td)
Returns
ServoyException – ServoyException exception or null when not available.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
var dbException = dataset.getException();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMaxColumnIndex
classnode
Table Row (tr)
idname
Table Cell (td)
getMaxColumnIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getMaxColumnIndex
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get the number of columns in the dataset.
Table Row (tr)
idret
Table Cell (td)
Returns
Number – int number of columns.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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 Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetMaxRowIndex
classnode
Table Row (tr)
idname
Table Cell (td)
getMaxRowIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Number
Span
stylefloat: left; font-weight: bold;
idiets
getMaxRowIndex
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Get the number of rows in the dataset.
Table Row (tr)
idret
Table Cell (td)
Returns
Number – int number of rows.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
var totalRows = dataset.getMaxRowIndex();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetRowAsArray
classnode
Table Row (tr)
idname
Table Cell (td)
getRowAsArray
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object[]
Span
stylefloat: left; font-weight: bold;
idiets
getRowAsArray
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Get the row data of a dataset as an Array.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} index – index of row (1-based).
Table Row (tr)
idret
Table Cell (td)
Returns
Object[] – Object array of data.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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 Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetValue
classnode
Table Row (tr)
idname
Table Cell (td)
getValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object
Span
stylefloat: left; font-weight: bold;
idiets
getValue
Span
stylefloat: left;
idiets
(row, col)
Table Row (tr)
iddes
Table Cell (td)
Get the value specified by row and column position from the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} row – row number, 1-based
{Number} col – column number, 1-based
Table Row (tr)
idret
Table Cell (td)
Returns
Object – Object value
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
var dataAtRow2Col1 = dataset.getValue(2, 1);
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idhadMoreData
classnode
Table Row (tr)
idname
Table Cell (td)
hadMoreData
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
hadMoreData
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Return true if there is more data in the resultset then specified by maxReturnedRows at query time.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – boolean more data available
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var ds = databaseManager.getDataSetByQuery('example_data', 'select order_id from orders', null, 10000)
if (ds.hadMoreData())
{
	// handle large result
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveColumn
classnode
Table Row (tr)
idname
Table Cell (td)
removeColumn
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
removeColumn
Span
stylefloat: left;
idiets
(index)
Table Row (tr)
iddes
Table Cell (td)
Remove a column by index from the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} index – index of column to remove (1-based)
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if succeeded, else false.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
var success = dataset.removeColumn(1); // removes first column
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveRow
classnode
Table Row (tr)
idname
Table Cell (td)
removeRow
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
removeRow
Span
stylefloat: left;
idiets
(row)
Table Row (tr)
iddes
Table Cell (td)
Remove a row from the dataset.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} row – row index to remove, -1 for all rows
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
dataset.removeRow(1); //removes the first row
dataset.removeRow(-1); //removes all rows
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetValue
classnode
Table Row (tr)
idname
Table Cell (td)
setValue
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
setValue
Span
stylefloat: left;
idiets
(row, col, obj)
Table Row (tr)
iddes
Table Cell (td)
Set the value specified by row and column position from the dataset.
Use row = -1, to set columnnames.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{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)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
dataset.getValue(2, 1,'data');
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsort-Number_Boolean
classnode
Table Row (tr)
idname
Table Cell (td)
sort
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
sort
Span
stylefloat: left;
idiets
(col, sort_direction)
Table Row (tr)
iddes
Table Cell (td)
Sort the dataset on the given column in ascending or descending.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Number} col – column number, 1-based
{Boolean} sort_direction – true for ascending, false for descending
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//assuming the variable dataset contains a dataset
dataset.sort(1,false)
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsort-Function
classnode
Table Row (tr)
idname
Table Cell (td)
sort
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
sort
Span
stylefloat: left;
idiets
(rowComparator)
Table Row (tr)
iddes
Table Cell (td)
Sort the dataset using a comparator function.
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.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{Function} rowComparator – the function used to compare two rows
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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;
}
Table Row (tr)
classlastDetailRow
Table Cell (td)