src/core/smart-data-source/smart-datasource.ts
BehaviorSubject
Properties |
|
Methods |
|
Accessors |
constructor(jsdo: progress.data.JSDO, name: string, initialFilter: any | string, initialSort: SortDescriptor[], injector?: Injector, partialDataset)
|
Creates an instance of SmartDataSource. |
Public afterSaveChanges |
Type : AfterEventCallback
|
A callback to be executed after saving changes. |
Public autoFetch |
Type : boolean
|
If set to false, prevents the Smart Data Source from auto fetching records when the filter or runtimeFilters have changed or when a selection changed event has been fired by a parent Smart Data Source, |
Public beforeSaveChanges |
Type : BeforeEventCallback
|
A callback to be executed before saving changes. |
clientSideCount |
Default value : false
|
Public foreignFieldMap |
Type : any
|
Public id |
Type : string
|
Public jsdo |
Type : progress.data.JSDO
|
Public parentDataSourceName |
Type : string
|
Public partialDataset |
Default value : false
|
Public selectionChanged |
Type : BehaviorSubject<SelectionChangedEventArgs>
|
Default value : new BehaviorSubject(null)
|
Fired when the selection is changed. |
Public serverSideFiltering |
Type : boolean
|
Public serverSideSorting |
Default value : true
|
Public state |
Type : StateEvents
|
Default value : StateEvents.IDLE
|
Public stateChanged |
Type : EventEmitter<DataSourceStateChangeEventArgs>
|
Default value : new EventEmitter<DataSourceStateChangeEventArgs>()
|
Fired when the datasource's state changes. |
Public useInitialValues |
Default value : false
|
Public addRecord | ||||||
addRecord(initialRecord?: any)
|
||||||
Adds a new record and puts the datasource in ADD_RECORD state.
Parameters :
Returns :
Promise<boolean>
|
Public cancelRecord |
cancelRecord()
|
Cancels all changes made to the currently selected record.
Returns :
void
|
Public clearAllFilters |
clearAllFilters()
|
Clears all initial and runtime filters
Returns :
void
|
Public clearFilter |
clearFilter()
|
Clears all non-runtime filters and reapplies the last query if there is one
Returns :
void
|
Public clearRuntimeFilter |
clearRuntimeFilter()
|
Clears all runtime filters and reapplies the last query if there is one
Returns :
void
|
Public deleteRecord |
deleteRecord()
|
Deletes the currently selected record.
Returns :
Promise<void>
|
Public fetch | ||||||
fetch(query?: IQuery)
|
||||||
Performs a read request and loads data.
Parameters :
Returns :
Promise<QueryResult>
|
Public getEmptyRecord |
getEmptyRecord()
|
Creates an empty record that adheres to the datasource's table schema.
Returns :
any
|
Public getJSDOSchemaForTable | ||||||
getJSDOSchemaForTable(tableName: string)
|
||||||
Parameters :
Returns :
JSDOFieldDefinition[]
JSDOFieldDefinition[] |
Public getSmartRestrictions |
getSmartRestrictions()
|
Returns :
SmartRestrictions
SmartRestrictions |
Public Async handleError | ||||||
handleError(request: any)
|
||||||
Parameters :
Returns :
{}
|
Public invokeMethod | ||||||||||||||||
invokeMethod(methodName: string, request: JSDOMethodRequest, handleErrors)
|
||||||||||||||||
Invokes a method that has been defined in the JSDO Catalog. An exception is thrown if the method is not defined in the catalog or if it is not of type "invoke".
Parameters :
Returns :
Promise<any>
|
Public namedQuery | ||||||
namedQuery(query: NamedQuery)
|
||||||
Parameters :
Returns :
Promise<QueryResult>
Promise |
Public refreshCurrentBatch |
refreshCurrentBatch()
|
Re-executes the last query.
Returns :
Promise<QueryResult>
|
Public saveChanges |
saveChanges()
|
Save all changes made to the selected record.
Returns :
Promise<void>
|
Public selectNextRecord |
selectNextRecord()
|
Selects the next loaded record. If the current record is also the last one, the first loaded record is selected.
Returns :
void
|
Public selectPreviousRecord |
selectPreviousRecord()
|
Selects the previous record. If the current record is also the first one, the last loaded record is selected.
Returns :
void
|
Public setFilter | ||||||
setFilter(value: any | any[] | string)
|
||||||
Parameters :
Returns :
void
|
Public setRuntimeFilter | ||||||
setRuntimeFilter(value: CompositeFilterDescriptor | FilterDescriptor[] | string)
|
||||||
Parameters :
Returns :
void
|
compoundedQueryFilter |
getcompoundedQueryFilter()
|
A filter object resulting from concatenating the data source's filter and runtimeFilters
Returns :
CompositeFilterDescriptor | string
|
totalRecords |
gettotalRecords()
|
The total number of records reported by the count method defined in the JSDO Catalog, or the number of loaded records if it is not defined.
Returns :
number
|
loadedRecords |
getloadedRecords()
|
The total number of loaded records.
Returns :
number
|
top |
gettop()
|
The maximum number of records to read in a single fetch request.
Returns :
number
|
skipRecords |
getskipRecords()
|
The number of records to skip when making a fetch request.
Returns :
number
|
filter | ||||
getfilter()
|
||||
The filter that the SmartDataSource is currently using, if any.
Returns :
any | string
|
||||
setfilter(value)
|
||||
The filter that the SmartDataSource should use for queries. When setting the filter property, the SmartDataSource will re-execute the last query, if any.
Parameters :
Returns :
void
|
hasPreviousQuery |
gethasPreviousQuery()
|
Returns :
boolean
|
updatingRecord | ||||||
getupdatingRecord()
|
||||||
Returns :
boolean
|
||||||
setupdatingRecord(value: boolean)
|
||||||
Parameters :
Returns :
void
|
addingRecord |
getaddingRecord()
|
True if the datasource is currently adding a record.
Returns :
boolean
|
selected | ||||||
getselected()
|
||||||
The currently selected record, if any
Returns :
any
|
||||||
setselected(value: any)
|
||||||
Sets the currently selected record.
Parameters :
Returns :
void
|
selectedIndex | ||||||
getselectedIndex()
|
||||||
Gets the index of the currently selected record.
Returns :
number
|
||||||
setselectedIndex(value: number)
|
||||||
Sets the current selected record index and updates the selection accordingly.
Parameters :
Returns :
void
|
primaryKeys |
getprimaryKeys()
|
The primary keys of the datasource's referenced table.
Returns :
string[]
|
sort | ||||||
getsort()
|
||||||
Gets the sort order that the datasource is currently using.
Returns :
SortDescriptor[]
|
||||||
setsort(value: [])
|
||||||
Sets the sort order that the datasource should use. If a query has already been made, it will be re-executed with the new setting.
Parameters :
Returns :
void
|
jsdoSchema |
getjsdoSchema()
|
Gets the underlying JSDO schema
Returns :
JSDOFieldDefinition[]
|
viewTables |
getviewTables()
|
The view tables that the underlying JSDO is using
Returns :
string[]
|
runtimeFilters | ||||
getruntimeFilters()
|
||||
Returns :
CompositeFilterDescriptor | [] | string
|
||||
setruntimeFilters(value)
|
||||
Parameters :
Returns :
void
|
tables |
gettables()
|
Returns :
any
|
tableRef |
gettableRef()
|
Returns :
string
|
isReadOnly |
getisReadOnly()
|
Returns :
boolean
|
isReadDisabled |
getisReadDisabled()
|
Returns :
boolean
|
isCreateDisabled |
getisCreateDisabled()
|
Returns :
boolean
|
isUpdateDisabled |
getisUpdateDisabled()
|
Returns :
boolean
|
isDeleteDisabled |
getisDeleteDisabled()
|
Returns :
boolean
|
name |
getname()
|
Returns :
string
|