File

src/core/smart-data-source/interfaces/idatasource.ts

Index

Properties
Methods

Methods

addRecord
addRecord(initialValues?: any)

Adds a new record to the data source

Parameters :
Name Type Optional Description
initialValues any Yes
  • Initial values for the new record
Returns : Promise<boolean>
  • A promise that resolves to true if the record was added successfully
cancelAll
cancelAll()

Cancels all changes

Returns : void
cancelRecord
cancelRecord()

Cancels changes to the current record

Returns : void
clear
clear()

Clears all data loaded on the client side and closes the data source's query

Returns : void
clearAllFilters
clearAllFilters()

Clears all initial and runtime filters

Returns : void
clearFilter
clearFilter()

Clears all non-runtime filters and reapplies the last query if there is one

Returns : void
clearRuntimeFilter
clearRuntimeFilter()

Clears all runtime filters and reapplies the last query if there is one

Returns : void
copyRecord
copyRecord(atIndex?: number)

Copies the currently selected record and selects the copy

Parameters :
Name Type Optional Description
atIndex number Yes
  • The index to insert the copy at
Returns : Promise<boolean>
  • A promise that resolves to true if the record was copied successfully
deleteRecord
deleteRecord()

Deletes the currently selected record

Returns : Promise<void>
  • A promise that resolves when the record is deleted
fetch
fetch(query?: IQuery)

Fetches data

Parameters :
Name Type Optional Description
query IQuery Yes
  • The query parameters
  • A promise that resolves with the query result
getDataSource
getDataSource()

Gets the data source as an observable

  • The data source observable
getEmptyRecord
getEmptyRecord()

Creates an empty record that adheres to the datasource's table schema

Returns : Partial<T>
  • An empty record
getSelectedRecords
getSelectedRecords()

Returns the selected records

Returns : T[]
  • The selected records
saveChanges
saveChanges()

Saves changes to the data source

Returns : Promise<void>
  • A promise that resolves when changes are saved
saveRecord
saveRecord()

Saves the current record

Returns : Promise<void>
  • A promise that resolves when the record is saved
selectNextRecord
selectNextRecord()

Selects the next record in the data source

Returns : void
selectPreviousRecord
selectPreviousRecord()

Selects the previous record in the data source

Returns : void
setActiveChild
setActiveChild(active: boolean)

Sets the active state of the child data source

Parameters :
Name Type Optional Description
active boolean No
  • Whether the child data source should be active
Returns : void
setFilter
setFilter(value: any | any[] | string)

Sets the filter that the SmartDataSource should use for queries

Parameters :
Name Type Optional Description
value any | any[] | string No
  • The filter value
Returns : void
setNavigationDisabled
setNavigationDisabled(value: boolean, sourceDataSourceName: string)

Sets whether navigation is disabled for the data source

Parameters :
Name Type Optional Description
value boolean No
  • Whether navigation should be disabled
sourceDataSourceName string No
  • The name of the source data source
Returns : void
setRuntimeFilter
setRuntimeFilter(value: CompositeFilterDescriptor | FilterDescriptor[] | string)

Sets the runtime filter

Parameters :
Name Type Optional Description
value CompositeFilterDescriptor | FilterDescriptor[] | string No
  • The runtime filter value
Returns : void

Properties

addingRecord
addingRecord: boolean
Type : boolean

Indicates whether the data source is currently adding a record

afterDelete
afterDelete: AfterEventCallback
Type : AfterEventCallback
Optional

Callback function to be executed after deleting

afterSaveChanges
afterSaveChanges: AfterEventCallback
Type : AfterEventCallback
Optional

Callback function to be executed after saving changes

autoFetch
autoFetch: boolean
Type : boolean
Optional

If set to true, the data source will automatically fetch data

autoSelectFirstRecord
autoSelectFirstRecord: boolean
Type : boolean

Indicates whether the Smart Data Source should automatically select the first record after fetching data

batchSize
batchSize: number
Type : number
Optional

The batch size for fetching data

beforeDelete
beforeDelete: BeforeEventCallback
Type : BeforeEventCallback
Optional

Callback function to be executed before deleting

beforeImage
beforeImage: T
Type : T

The before-image (pristine, immutable copy) of the currently selected record, captured at selection time and refreshed on save/cancel/ selection-change. Counterpart to selected.

beforeSaveChanges
beforeSaveChanges: BeforeEventCallback
Type : BeforeEventCallback
Optional

Callback function to be executed before saving changes

compoundedQueryFilter
compoundedQueryFilter: CompositeFilterDescriptor | string
Type : CompositeFilterDescriptor | string

A filter object resulting from concatenating the data source's filter and runtimeFilters

copyingRecord
copyingRecord: boolean
Type : boolean

Indicates whether the data source is currently copying a record

dataRequested
dataRequested: DataRequestedCallback
Type : DataRequestedCallback
Optional

Callback function to be executed when data is requested

filter
filter: any
Type : any
Optional

The filter applied to the data source

foreignFieldMap
foreignFieldMap: any
Type : any
Optional

Map of foreign fields for parent-child relationships

id
id: string
Type : string

The unique identifier for the data source

instanceName
instanceName: string
Type : string

The instance name of the data source

isActiveChild
isActiveChild: boolean
Type : boolean

In the case of child data sources, indicates whether the data source will react to parent data source selection changes

isCreateDisabled
isCreateDisabled: boolean
Type : boolean

Indicates whether create access is disabled

isDeleteDisabled
isDeleteDisabled: boolean
Type : boolean

Indicates whether delete access is disabled

isReadDisabled
isReadDisabled: boolean
Type : boolean

Indicates whether read access is disabled

isReadOnly
isReadOnly: boolean
Type : boolean

Indicates whether the data source is in read-only mode

isUpdateDisabled
isUpdateDisabled: boolean
Type : boolean

Indicates whether update access is disabled

jsdoSchema
jsdoSchema: JSDOFieldDefinition[]
Type : JSDOFieldDefinition[]

The JSDO schema for the data source

loadedRecords
loadedRecords: number
Type : number

The number of records currently loaded in the data source

name
name: string
Type : string

The name of the data source

objectName
Use instanceName instead
objectName: string
Type : string

The object name of the data source

parentDataSource
parentDataSource: any
Type : any
Optional

Reference to the parent data source if this is a child data source

parentDataSourceName
parentDataSourceName: string
Type : string

The name of the parent data source

runtimeFilters
runtimeFilters: CompositeFilterDescriptor | FilterDescriptor[] | string
Type : CompositeFilterDescriptor | FilterDescriptor[] | string

Runtime filters applied to the data source

selected
selected: T
Type : T

The currently selected record

selectedIndex
selectedIndex: number
Type : number

The index of the currently selected record

selectionChanged
selectionChanged: EventEmitter<SelectionChangedEventArgs<T>>
Type : EventEmitter<SelectionChangedEventArgs<T>>

Event emitter for selection changes

skipRecords
skipRecords: number
Type : number
Optional

The number of records to skip when fetching

sort
sort: SortDescriptor[] | string
Type : SortDescriptor[] | string
Optional

The sort descriptors applied to the data source

state
state: StateEvents
Type : StateEvents

The current state of the data source

stateChanged
stateChanged: EventEmitter<DataSourceStateChangeEventArgs>
Type : EventEmitter<DataSourceStateChangeEventArgs>

Event emitter for state changes

top
top: number
Type : number
Optional

The maximum number of records to fetch

updatingRecord
updatingRecord: boolean
Type : boolean

Indicates whether the data source is currently updating a record

results matching ""

    No results matching ""