File

src/ui/data-source/smart-datasource.component.ts

Description

The Angular Component wrapper over the SmartDataSource. Used for providing a declarative way of initializing a SmartDataSource.

Extends

AbstractSmartComponent

Implements

OnInit OnChanges

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(serviceAdapter: SmartServiceAdapter, registry: DataSourceRegistry, smartErrorHandler: SmartErrorHandlerService, toolbarRegistry: SmartToolbarRegistry, filterRegistry: SmartFilterRegistry, injector: Injector, route: ActivatedRoute, vcRef: ViewContainerRef)
Parameters :
Name Type Optional
serviceAdapter SmartServiceAdapter No
registry DataSourceRegistry No
smartErrorHandler SmartErrorHandlerService No
toolbarRegistry SmartToolbarRegistry No
filterRegistry SmartFilterRegistry No
injector Injector No
route ActivatedRoute No
vcRef ViewContainerRef No

Inputs

after-delete
Type : AfterEventCallback

Optional function that will be called after a delete operation.

after-save-changes
Type : AfterEventCallback

Optional callback. If set, it will be called after a save changes operation.

before-delete
Type : BeforeEventCallback

Optional function that will be called before a delete operation.

before-save-changes
Type : BeforeEventCallback

Optional callback. If set, it will be called before a save changes operation.

data-requested
Type : DataRequestedCallback

Optional function that will be called when the data source is fetching data.

get-initial-values
Type : boolean

If set to true, when adding a new record, the Smart Data Source will set initial (default) values for the new record.

smart-active-on-pages
Type : string

Only applies to child data sources. Takes a comma separated list of page keys as a value. If set, the child data source will be activated when the specified pages are active.

smart-auto-fetch
Type : boolean

When set to false, prevents the Smart Data Source to auto fetch data when the filter or runtimeFilters have changed, or when a selection changed event has been fired by a parent Smart Data Source

smart-auto-select-first-record
Type : boolean

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

smart-batch-size
Type : number

The batch size to be used for the Smart Data Source.

smart-business-entity-name
Type : string

The Smart Business Entity name, used for initializing the underlying JSDO

smart-data-source
Type : string

Specifies the parent data source. If set, the data source will subscribe to to the parent data source and filter according to it's selection. To be used alongside the "smart-foreign-fields" attribute

smart-entity-table
Type : string

The table that should be set as tableRef for the underlying JSDO

smart-entity-view
Type : string

The JSDO table views

smart-filter
Type : any

If set, the SmartDataSource will be initialized with this filter.

smart-filter-source
Type : string

Optional attribute that takes the smart-object-name of a Smart Filter as a value. If set, the data source will append filters generated by the Smart Filter when it's filter button is clicked.

smart-foreign-fields
Type : string

To be used alongside the "smart-data-source" attribute. It is used to specify the foreign key relation between the parent and the child data sources.

smart-navigation-source
Type : string

Optional attribute that takes the smart-object-name of a Smart Toolbar as a value. If set, the data source will adjust it's selection when the specified toolbar's navigation buttons are clicked.

smart-partial-dataset
Type : boolean

Deprecated no-op. Partial dataset handling is derived from the JSDO table reference root-table metadata.

smart-read-requests-cancellable
Type : boolean

If set to true, ongoing read operations may be cancelled by using the cancelCurrentRequest() method.

smart-server-side-filtering
Type : boolean

Determines if the Smart Data Source will perform server side filtering. The default value is true.

smart-server-side-sorting
Type : boolean
smart-sort
Type : SortDescriptor[] | string

If set, the SmartDataSource will be initialized with these sort options.

smart-stop-after
Type : number

The amount of time (in seconds) after which the data source will stop the current request.

smart-instance-name
Type : string

The instance name of the component

smart-object-name
Type : string

The object name of the component

Outputs

on-ready
Type : EventEmitter<SmartDataSource>

Fires when the SmartDataSource has been initialized.

selection-changed
Type : EventEmitter<SelectionChangedEventArgs>

Fires when a selection change has occurred.

state-changed
Type : EventEmitter<DataSourceStateChangeEventArgs>

Fires when the state of the SmartDataSource has changed.

Methods

Public fetch
fetch(query: IQuery)
Parameters :
Name Type Optional Default value
query IQuery No { tableRef: this.table }
Returns : void

Properties

dataSource
Type : SmartDataSource

The initialized SmartDataSource object.

Accessors

beforeSaveChanges
setbeforeSaveChanges(value: BeforeEventCallback)

Optional callback. If set, it will be called before a save changes operation.

Parameters :
Name Type Optional
value BeforeEventCallback No
Returns : void
dataRequested
setdataRequested(value: DataRequestedCallback)

Optional function that will be called when the data source is fetching data.

Parameters :
Name Type Optional
value DataRequestedCallback No
Returns : void
beforeDelete
setbeforeDelete(value: BeforeEventCallback)

Optional function that will be called before a delete operation.

Parameters :
Name Type Optional
value BeforeEventCallback No
Returns : void
afterDelete
setafterDelete(value: AfterEventCallback)

Optional function that will be called after a delete operation.

Parameters :
Name Type Optional
value AfterEventCallback No
Returns : void
afterSaveChanges
setafterSaveChanges(value: AfterEventCallback)

Optional callback. If set, it will be called after a save changes operation.

Parameters :
Name Type Optional
value AfterEventCallback No
Returns : void
stopAfter
getstopAfter()
Returns : number
setstopAfter(value: number)

The amount of time (in seconds) after which the data source will stop the current request.

Parameters :
Name Type Optional
value number No
Returns : void
parentDs
getparentDs()
Returns : string
setparentDs(value: string)

Specifies the parent data source. If set, the data source will subscribe to to the parent data source and filter according to it's selection. To be used alongside the "smart-foreign-fields" attribute

Parameters :
Name Type Optional
value string No
Returns : void
serverSideSorting
getserverSideSorting()
Returns : boolean
setserverSideSorting(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""