Download the PHP package sandstorm/lazydatasource without Composer
On this page you can find all versions of the php package sandstorm/lazydatasource. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sandstorm/lazydatasource
More information about sandstorm/lazydatasource
Files in sandstorm/lazydatasource
Package lazydatasource
Short Description Neos package implementing a lazy data source for the UI; so that the elements are loaded lazily on demand.
License MIT
Homepage https://github.com/sandstorm/LazyDataSource
Informations about the package lazydatasource
Sandstorm.LazyDataSource
Inspector Data Sources in Neos are usually eager, this means the UI sends a single request to the backend to load all options, and then doing the filtering client-side.
This package implements additional Inspector Editors, behaving like the standard SelectBoxEditor with data sources, but delegates filtering and searching to the server-side.
This greatly improves Neos UI performance for data sources with big collections (100s of elements).
Getting started
-
Default composer installation via:
-
for a single select:
In your
NodeTypes.yaml
, activate the custom editor by usingSandstorm.LazyDataSource/Inspector/Editors/DataSourceSelectEditor
instead ofNeos.Neos/Inspector/Editors/SelectBoxEditor
. **All configuration options of the data source-based select apply as usual.Additionally, we support the following additional
editorOptions
:dataSourceMakeNodeIndependent
: if set to TRUE, the currently selected node is NOT sent to the data source on the backend, increasing the cache lifetime on the client (e.g. the system can re-use elements from other nodes)
Example:
-
for a multi select:
In your
NodeTypes.yaml
, activate the custom editor by usingSandstorm.LazyDataSource/Inspector/Editors/DataSourceSelectEditor
instead ofNeos.Neos/Inspector/Editors/SelectBoxEditor
. **All configuration options of the data source-based select apply as usual.Additionally, we support the following additional
editorOptions
:dataSourceMakeNodeIndependent
: if set to TRUE, the currently selected node is NOT sent to the data source on the backend, increasing the cache lifetime on the client (e.g. the system can re-use elements from other nodes)
Example:
Do not forget to set the property type to
array<string>
. -
In your
DataSource
implementation on the server, use theLazyDataSourceTrait
and implement the two methodsgetDataForIdentifiers()
andsearchData()
. Do not implementgetData()
(as this is provided by the trait).getDataForIdentifiers()
is called during the initial call, when the client-side needs to resolve entries for certain identifiers.searchData()
is called when the user has entered a search term, and needs to perform the searching.
The return value for both methods needs to be the same as for normal data sources.
Example:
Development
This project works with yarn. The build process given by the neos developers is not very configurable, only the target dir for the buildprocess is adjustable by package.json.
If you don't have yarn already installed:
Build the app:
Contribute
You are very welcome to contribute by merge requests, adding issues etc.