Giter VIP home page Giter VIP logo

Comments (3)

javiereguiluz avatar javiereguiluz commented on June 14, 2024

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.

misterx avatar misterx commented on June 14, 2024

@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.

misterx avatar misterx commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.