DataSet
DataSets are how we access a data on a Data² Table. It contains rules and specification on what the data coming from the table is. E.g. In a table of pets, a dataset could only show dogs with brown fur.
Reference
Parameters
master
An automated filter based on another DataSet. Pick a field, a master DataSet, and a Master Field to configure this property. When set, this DataSet will only show entries in which the field has the data equal to the Master Field of the Master DataSet current cursor.
Component data2-core-types@DataSetMaster
filter
Initial Filter settings of this DataSet. Using the interaction "filter" overwrites this setting.
Component data2-core-types@DataSetFilter
fields
list
Of all fields in the Table, what are those you want present in this DataSet? If left empty, will always get all Table fields.
Component data2-core-types@FieldReference
pagination
Limits the amount of data the DataSet retrieves from the table. This can be used to split the amount of records of the DataSet into pages. By default, the DataSet has a limit of 1000 Records.
Component data2-core-primitives@Object
size
: data2-core-primitives@Numberskip
: data2-core-primitives@Number
Amount of records per page.
Amount of records to skip. For a page size of 5, a skip of 5 will show the second page fully, while a skip of 3 will show 2 elements of the first page.
refreshOnEdit
If enabled, forces a refresh before editing the current cursor.
Component data2-core-primitives@Boolean
select
Specify which record should be selected when the DataSet initially loads. Has no effect if the AutoSelect is not enabled.
Component data2-core-types@DataSetSelectSettings
autoSelect
When the DataSet is first loaded in a page, whether it should automatically select its first item or not.
Component data2-core-primitives@Boolean
sort
Sorting settings for the DataSet. Changes the order in which the results show on the DataSet.
Component data2-core-types@DataSetSort
requiresConfirmation
If active, asks the user to confirm deletion before actually deleting the selected records. You may change the type to be an InteractiveModuleReference, and pick a custom DialogService for using a custom Dialog.
Component data2-core-primitives@Boolean
policies
list
Controls for allowing or denying access to the data on the DataSet.
Component data2-core-auth@Policy
pk
Primary field of the table. Should be changed only if the table is a Custom Data Source. Defaults to the "_id" field.
Component data2-core-types@DataSetColumnReference
visibilityMode
Component data2-core-primitives@String
One of 'hide_deleted' | 'only_show_deleted' | 'show_all'
aggregations
list
Configure settings for counting data, filtering, taking averages and other operations for analysing the data on a table.
Component data2-core-registry@DataSetAggregation
lookupDataSets
Component data2-core-primitives@Inferred
lookupPopulateDepths
Component data2-core-primitives@Inferred
Interactions
insert
save
edit
cancel
Arguments
- Options data2-core-primitives@Object
Cancel options
disableRefresh
: data2-core-primitives@Boolean
Disables refresh after cancel.
delete
refresh
filter
Arguments
Query to filter dataset.
select
Arguments
- Field data2-core-types@DataSetColumnReference required
Field to be used to select Record.
- Field value data2-core-primitives@String required
Value of the field.
next
prev
nextPage
appendNextPage
downloadAsCsv
Arguments
- Options data2-core-primitives@Object
Download as CSV options
delimiter
: data2-core-primitives@Booleanencoding
: data2-core-primitives@BooleanshouldPopulateLookups
: data2-core-primitives@BooleanbrazilianExcelFormat
: data2-core-primitives@Booleanfilename
: data2-core-primitives@String
One of ',' | ';'
Delimiter for generated file. Default is ",".
One of 'utf-8' | 'windows-1252'
Encoding for generated file. Default is "utf-8".
Controls whether fully populated data is exported to the CSV.
Controls whether the CSV will be generated compatible with PT-BR Excel.
Filename of the downloaded file. By default, it is the reference of the dataset.
uploadCsv
Arguments
- options data2-core-primitives@Object
unsetEmptyFields
: data2-core-primitives@BooleanlogOnly
: data2-core-primitives@Boolean
If true, will unset fields that are left empty in CSV from the record.
If true, only log what is going to be created and updated. Useful to preview what will happen before running uploadCsv for real.
downloadModel
previousPage
clearFilters
paginate
Arguments
- pagination data2-core-primitives@Object
toggleSort
Arguments
sync
insertRecord
Arguments
- Record No component
search
Arguments
- Search settings data2-core-primitives@Object
Search filter
search
: data2-core-primitives@Stringlanguage
: data2-core-primitives@StringcaseSensitive
: data2-core-primitives@BooleandiacriticSensitive
: data2-core-primitives@Boolean
saveRecord
Arguments
- Record No component
resetFilters
sort
Arguments
- Sort settings data2-core-types@FieldSet
Settings to sort the dataset.
unselect
downloadAsXlsx
Arguments
- Options data2-core-primitives@Object
Options for downloadAsXlsx
useTitle
: data2-core-primitives@Boolean
Option to enable using the field title.
loadAllPages
exportToCsv
Arguments
- Options data2-core-primitives@Object
Export to CSV options
delimiter
: data2-core-primitives@BooleanshouldPopulateLookups
: data2-core-primitives@BooleanbrazilianExcelFormat
: data2-core-primitives@Boolean
One of ',' | ';'
Delimiter for generated file. Default is ",".
Controls whether fully populated data is exported to the CSV.
Controls whether the CSV will be generated compatible with PT-BR Excel.