src/core/smart-data-source/abstract-smart-data-source.ts
ReplaySubject
ISmartDataSource
ICRUDHookable
IDataBoundControl
constructor(config: AbstractSmartDataSourceConfig)
|
||||||
|
Parameters :
|
| Public afterDelete |
Type : AfterEventCallback
|
|
Callback function to be executed after deleting. |
| Public afterSaveChanges |
Type : AfterEventCallback
|
|
Callback function to be executed after saving changes. |
| Public Optional autoFetch |
Type : boolean
|
|
If set to true, the data source will automatically fetch data. |
| Abstract autoSelectFirstRecord |
Type : boolean
|
| Public Optional batchSize |
Type : number
|
|
The batch size for fetching data. |
| Public beforeDelete |
Type : BeforeEventCallback
|
|
Callback function to be executed before deleting. |
| Public beforeSaveChanges |
Type : BeforeEventCallback
|
|
Callback function to be executed before saving changes. |
| Public Readonly config |
Type : AbstractSmartDataSourceConfig
|
| Public dataRequested |
Type : DataRequestedCallback
|
|
Callback function to be executed when data is requested. |
| Public foreignFieldMap |
Type : any
|
| Public getInitialValues |
Type : boolean
|
| instanceName |
Type : string
|
| Public name |
| Use instanceName instead |
Type : string
|
|
The unique name by which the data source will be identified. |
| objectName |
| Use instanceName instead |
Type : string
|
| Readonly queryResultSignal |
Type : WritableSignal<QueryResult<unknown>>
|
Default value : signal({ data: [], total: 0 })
|
| Readonly selectedIndexSignal |
Type : WritableSignal<number>
|
Default value : signal(-1)
|
|
Signal for reactive selected index tracking. Automatically updated when selectionChanged emits. |
| Readonly selectedSignal |
Type : WritableSignal<unknown | null>
|
Default value : signal(null)
|
|
Signal for reactive selected record tracking. Automatically updated when selectionChanged emits. |
| selectionChanged |
Type : EventEmitter<SelectionChangedEventArgs<unknown>>
|
Default value : new EventEmitter()
|
| Public Abstract Optional skipRecords |
Type : number
|
| Public state |
Type : StateEvents
|
| Readonly stateChanged |
Type : EventEmitter<DataSourceStateChangeEventArgs>
|
Default value : new EventEmitter<DataSourceStateChangeEventArgs>()
|
| Readonly stateSignal |
Type : WritableSignal<StateEvents>
|
Default value : signal(
StateEvents.IDLE
)
|
|
Signal for reactive state tracking. Automatically updated when stateChanged emits. |
| Public Abstract Optional top |
Type : number
|
| Public Abstract addRecord | |||||||||
addRecord(initialValues?: Partial
|
|||||||||
|
Parameters :
Returns :
Promise<boolean>
|
| Public Abstract cancelAll |
cancelAll()
|
|
Returns :
void
|
| Public Abstract cancelRecord |
cancelRecord()
|
|
Returns :
void
|
| Public Abstract clear |
clear()
|
|
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 Abstract copyRecord | ||||||
copyRecord(atIndex?: number)
|
||||||
|
Parameters :
Returns :
Promise<boolean>
|
| Public Abstract deleteRecord |
deleteRecord()
|
|
Returns :
Promise<void>
|
| Public Abstract fetch | ||||||
fetch(query?: IQuery)
|
||||||
|
Parameters :
Returns :
Promise<QueryResult<unknown>>
|
| Public fetchInitialData |
fetchInitialData()
|
|
Performs the initial auto-fetch using the same query shape as the constructor-time auto-fetch path.
Returns :
Promise<QueryResult<unknown>>
|
| Public getDataSource |
getDataSource()
|
|
Gets the data source
Returns :
Observable<ISmartDataSource<unknown>>
the data source |
| Public Abstract getEmptyRecord |
getEmptyRecord()
|
|
Returns :
Partial<unknown>
|
| Public getSelectedRecords |
getSelectedRecords()
|
|
Returns the selected records
Returns :
unknown[]
the selected records |
| Public Abstract saveChanges |
saveChanges()
|
|
Returns :
Promise<void>
|
| Public Abstract saveRecord |
saveRecord()
|
|
Returns :
Promise<void>
|
| Public Abstract selectNextRecord |
selectNextRecord()
|
|
Returns :
void
|
| Public Abstract selectPreviousRecord |
selectPreviousRecord()
|
|
Returns :
void
|
| Public setActiveChild | ||||||
setActiveChild(active: boolean)
|
||||||
|
Sets the active state of the child data source. If the data source is set to active, it will fetch data when the parent data source has a valid selection.
Parameters :
Returns :
void
|
| Public setFilter | ||||||
setFilter(value: any | any[] | string)
|
||||||
|
Parameters :
Returns :
void
|
| Public setNavigationDisabled |
setNavigationDisabled(val: boolean, sourceDsName: string)
|
|
Returns :
void
|
| Public setRuntimeFilter | ||||||
setRuntimeFilter(value: CompositeFilterDescriptor | FilterDescriptor[] | string)
|
||||||
|
Parameters :
Returns :
void
|
| Public setSortWithoutRefresh | ||||||||
setSortWithoutRefresh(value: SortDescriptor[] | string)
|
||||||||
|
Sets the sort order without refreshing the last query.
Parameters :
Returns :
void
|
| Public subscribe | ||||||
subscribe(observerOrNext?: Partial<Observer<QueryResult<unknown>>> | unknown)
|
||||||
|
Parameters :
Returns :
Subscription
|
| Public subscribe | ||||||||||||
subscribe(next?: (value?: QueryResult
|
||||||||||||
|
Parameters :
Returns :
Subscription
|
| Public unsubscribe |
unsubscribe()
|
|
Unsubscribes from all subscriptions and sets the observed flag to false.
Returns :
void
|
| selected | ||||||
getselected()
|
||||||
setselected(value: unknown)
|
||||||
|
Parameters :
Returns :
void
|
| selectedIndex | ||||||
getselectedIndex()
|
||||||
setselectedIndex(value: number)
|
||||||
|
Parameters :
Returns :
void
|
| updatingRecord | ||||||
getupdatingRecord()
|
||||||
setupdatingRecord(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| copyingRecord | ||||||
getcopyingRecord()
|
||||||
setcopyingRecord(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| isCreateDisabled |
getisCreateDisabled()
|
| isUpdateDisabled |
getisUpdateDisabled()
|
| isDeleteDisabled |
getisDeleteDisabled()
|
| isReadDisabled |
getisReadDisabled()
|
| isReadOnly |
getisReadOnly()
|
| loadedRecords |
getloadedRecords()
|
| addingRecord | ||||||
getaddingRecord()
|
||||||
|
Returns :
boolean
|
||||||
setaddingRecord(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| beforeImage |
getbeforeImage()
|
|
The before-image (pristine, immutable copy) of the currently selected record. Returns a deep copy of _selectedCopy so callers cannot mutate the stored pristine record. A record being added or copied is a new (created) record with no before-image, matching the JSDO save convention which omits the before-image for created rows. Subclasses with editable child grids may override this to refine a child table's before-image from the child data source that tracks it.
Returns :
unknown
|
| runtimeFilters | ||||||
getruntimeFilters()
|
||||||
|
Returns :
any
|
||||||
setruntimeFilters(value: any)
|
||||||
|
Parameters :
Returns :
void
|
| parentDataSource |
getparentDataSource()
|
|
Returns :
ISmartDataSource
|
| isActiveChild |
getisActiveChild()
|
|
In the case of child data sources, it indicates whether the data source will react to parent data source selection changes
Returns :
boolean
|
| jsdoSchema |
getjsdoSchema()
|
| sort | ||||||
getsort()
|
||||||
|
Gets the sort order that the datasource is currently using.
Returns :
[] | string
|
||||||
setsort(value: SortDescriptor[] | string)
|
||||||
|
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
|
| compoundedQueryFilter |
getcompoundedQueryFilter()
|
|
A filter object resulting from concatenating the data source's filter and runtimeFilters
Returns :
CompositeFilterDescriptor | string
|
| filter | ||||||
getfilter()
|
||||||
|
The filter that the SmartDataSource is currently using, if any.
Returns :
any | string
|
||||||
setfilter(value: any | string)
|
||||||
|
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
|
| parentDataSourceName | ||||||
getparentDataSourceName()
|
||||||
|
Returns :
string
|
||||||
setparentDataSourceName(val: string)
|
||||||
|
Parameters :
Returns :
void
|
| id |
getid()
|
|
Returns :
string
|
| observed | ||||||
getobserved()
|
||||||
|
Indicates whether the data source is currently being observed.
Returns :
boolean
|
||||||
setobserved(value: boolean)
|
||||||
|
Sets whether the data source is currently being observed.
Parameters :
Returns :
void
|