DataProvider
The silk:DataProvider component extracts data from a database using a Data Outlet, which is linked to an Object Relational Mapping (ORM) file that defines the data interaction.
The DataProvider is also the repository of the information loaded from the database. Other components can access the stored data.
Operates as a standalone when connecting to an external service.
Tag Definition
Used standalone:
Used as a container:
JSON String
The silk:DataProvider can also be used with pre-defined data. In this case, the DataProvider will host an array of JSON objects, which will be loaded during the initialization process. The DataProvider will not interact with the server in this scenario, so the servicePath property is unnecessary. The typical use for this scenario is to store data that is only valid in the application domain.
If the property pkColumn is not provided, it defaults to the name "value".
The data provided can also be received as pre-defined data in the format of "value:label" to facilitate building a simple list.
This format will generate a JSON array with value and label attributes.
DataSevice
In cases when a silk:DataProvider has to access different Data Outlets based on runtime logic, the element silk:DataService provides the logic property renderIf to choose the appropriate service path and/or select name.
Properties
*Required property.
id*
Unique component identifier. Default Value: Empty.
servicePath
Sets the path to the outlet service providing access to the data. If the value is "silkVariable" it will load the flag variables as a JSON string. The selectName should indicate the variable group. If the value is silkLang" it will load the languages list as a JSON string. Default Value: Empty.
selectName
The name of the Select tag in the ORM file. Default Value: Empty.
autoLoad
If true, the component will load the data from the server after being initialized. If false, the loading method will be triggered externally. The default value is "true". Default Value: true.
loadingOrder
Defines the numeric value used to order the loading process of multiple DataProviders when the application starts. This does not affect loading programmatically triggered. Determining the loading order is essential to compensate for data dependency while displaying data. Default Value: 000.
treeData
If true, it activates the support for hierarchical information or trees nodes. This requires the fields root, parent, and level in the tags column in the ORM file. Default Value: false.
markDeleted
If true, the delete action will change to update the field. The records will be visually removed from the list. Default Value: false.
debugLevel
A numeric value indicating the level of debugging to be displayed. Default Value: 0.
isPublic
If true the data will be served from a public outlet service. This is only necessary when a private application will use a public data outlet. Default Value: false.
pkColumn
Sets the name of the columns used as the primary key when different from the DataProvider. Should be used when the DataProvider has been created using static JSON data. Default Value: Empty.
detailDP
Defines a DataProvider that will be loaded when clicking on an associated silk:Table row. Default Value: Empty.
recordSync
If true, it will load an ORM select containing extra columns for the selected record. This will trigger a second click event in the connected component after the synchronization process is completed. Default Value: Empty.
dpSort
Determines if the sorting process will run in the database. This does not work if the dataProvider property treeData is set to "true". Default Value: Empty.
timeout
Set the time, in milliseconds, for the Ajax request to timeout if it does not receive an answer. Default Value: Empty.
renderIf
Last updated