An ID that uniquely identifies the data provider among all data providers. Generated automatically the following way in case it is not set:
A Promise which resolves when this Component has been successfully initialized.
The column that is used as the key of the data models. This can be a column name that returns the key value of a given data model.
If this is not set, the primary keys of modelClass will be used.
Model Class which can be used for resolving Attribute Labels, Hints etc.
Th adapter for the ORM which is being used for the Application. eg:- SequelizeAdapter
the query that is used to fetch data models and totalCount if it is not explicitly set. This structure of this property depends upon the ORM being used. Example for Sequelize: let provider = new ActiveDataProvider({ modelClass: Post, query: { where: { companyId: 123 createdDate: {[Op.lte]: Date.now() //createdDate less than or equal to now. } } }); provider.getModels(); // returns the models matching the current query.
Promise which resolves to the number matching records for the current query.
Returns the number of data models in the current page.
the number of data models in the current page.
Returns the key values associated with the data models.
the list of key values corresponding to [[models]]. Each data model in [[models]] is uniquely identified by the corresponding key value in this array.
Returns the data models in the current page.
the list of data models in the current page.
Returns the pagination object used by this data provider. Note that you should call prepare or getModels first to get correct values of Pagination.totalCount and [[Pagination::pageCount]].
the pagination object. If this is false, it means the pagination is disabled.
Returns the sorting object used by this data provider.
the sorting object. If this is false, it means the sorting is disabled.
Returns the total number of data models. When pagination is false, this returns the same value as count. Otherwise, it will call prepareTotalCount to get the count.
total number of possible data models.
Initializes the ORM Adapter. This method will initialize the ormAdapter property (when set) to make sure it refers to a valid ORM Adapter.
Prepares the data models and keys.
whether to force data preparation even if it has been done before.
Prepares the keys associated with the currently available data models.
Prepares the data models that will be made available in the current page.
Returns a value indicating the total number of data models in this data provider.
Refreshes the data provider. After calling this method, if getModels, getKeys or getTotalCount is called again, they will re-execute the query and return the latest data available.
Sets the data models in the current page.
the models in the current page
Sets the pagination for this data provider.
the pagination to be used by this data provider. This can be one of the following:
Sets the sort definition for this data provider.
Sets the total number of data models.
the total number of data models.
Generated using TypeDoc
ActiveDataProvider implements a data provider based on db queries.
ActiveDataProvider provides real time data by performing DB queries using query.
The following is an example of using ActiveDataProvider to provide ActiveRecord instances:
For more details and usage information on ActiveDataProvider, see the guide article on data providers.
Mahesh S Warrier https://github.com/codespede