Comments (3)
This is not a built-in feature ... but maybe you can achieve it as follows:
(1) Add some property of the entity in that column (or make it a virtual column not referring to any property)
(2) Mark the property as not sortable
(3) Use the formatValue()
method (https://symfony.com/bundles/EasyAdminBundle/current/fields.html#formatting-options) and there, call your service (which you have to previously inject in the controller)
Cheers!
from easyadminbundle.
@javiereguiluz, Is there a way to gather all selected entities before processing fields?
I'm asking because I have a service that retrieves data from another data store using a REST API. This service has a method like RemoteDataService::getDataByIds(string ...$id)
. Using the formatValue
callback to fetch only one remote record for each entity is not optimal. I'm looking for a solution where I can get the collection of entities before processing fields and preload data for rendering. It's related for INDEX action.
from easyadminbundle.
My current workaround involves using the EntityFactory decorator, but it's not possible without the easycorp/easyadmin-no-final-plugin
package, as EntityFactory lacks an interface. I don't think it looks like the proper way to achieve this functionality. Here's my implementation https://gist.github.com/misterx/703f253a37b40c312b032659f4e38a21
from easyadminbundle.
Related Issues (20)
- EntityManager::addSearchClause throw exception on Postgresql databases HOT 1
- Dynamic label for custom actions
- Inconsistent behaviour when no entityId is passed to detail page
- Stop using PATCH HOT 18
- Default field for boolean property doesn't load field-boolean.js HOT 4
- Add some join for default query for NEW, EDIT, and DETAIL pages HOT 2
- EasyAdmin Autocomplete clear behaviour
- [Doc] Add an example of custom CRUD action
- Not possible to link a symfony controller HOT 1
- Feature Request: add edit link to Entity grid row name
- Route definitions in read-only file systems
- PercentField ignores "numDecimals" option
- Filters of the previous page shouldn't be passed to the next pages
- Add options to customize `ArrayField` button labels
- Text fields Max Length option is ignored HOT 7
- It doesn't create related records
- Dashboard title tag not set using content_title block HOT 1
- TextEditorType does not render in custom FieldType HOT 1
- How to use same function for two Entity Event ? HOT 1
- CollectionField: Add item and remove buttons do not work in EasyAdmin 4 CRUD update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyadminbundle.