SonataAdminBundle icon indicating copy to clipboard operation
SonataAdminBundle copied to clipboard

Add search to list view

Open core23 opened this issue 4 years ago • 5 comments

Feature Request

I'm planing to add a new feature which adds a new search field on each admin list. You can search for entities that may contain the searched value.

Screenshot 2021-03-07 at 16 32 35

This can be done via a new SearchableAdminInterface:

interface SearchableAdminInterface
{
    /**
     * List of fields that are searchable
     * 
     * @return string[]
     */
    public function getSearchFields(): array;
}

class SomeAdmin extends AbstractAdmin implements SearchableAdminInterface
{
    public function getSearchFields(): array 
   {
       return ['address', 'name', 'description'];
   }
}

core23 avatar Mar 07 '21 15:03 core23

I agree with the resulting feature, but I think we should consider the current implementation we have around the global_search option in the field description.

phansys avatar Mar 08 '21 10:03 phansys

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 17 '21 16:10 github-actions[bot]

HI @core23, I saw the bot added the stale label. Do you still work on this feature ?

VincentLanglet avatar Jan 31 '22 20:01 VincentLanglet

I got this feature running on my local machine, but I need some time to integrate this into the existing sonata code.

core23 avatar Feb 01 '22 09:02 core23

Hi @core23, are you still able to provide a PR for this feature ?

VincentLanglet avatar Aug 21 '22 11:08 VincentLanglet

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 17 '23 12:02 github-actions[bot]