OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions Autocomplete Search field

This topic contains 2 replies, has 3 voices, and was last updated by  alendo 9 years, 3 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #35901

    changwuf31
    Participant

    I’ve created a person entity, and I want to create an oro_entity_create_or_select type that filter by name and also by gender. And maybe a few other parameters.
    Is this possible ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #35902

    Hi.
    To achieve this next steps has to be performed:

    – Create Form type with parent set to ‘oro_entity_create_or_select_inline’. In defaults set autocomplete_alias and create_form_route. grid_name may be set to grid name which will be used in search dialog, if it does not set then grid_name from entity configuration will be used.

    – Add search.yml and define search rules for your Person entity there

    – Add service for autocomplete search handler. Tag it with oro_form.autocomplete.search_handler DI tag, set alias to your autocomplete_alias used in form type, set acl_resource.

    – Execute app/console oro:search:index for creating new indexes

    – (optional) For Person entity add form configuration scope and set form_type to your select type and grid_name that will be used by oro_entity_create_or_select_inline element as grid_name

    #35903

    alendo
    Participant

    Hi Dmitry
    I followed the steps you suggested, but I have two problems: the autocomplete does not work for me, and even if the datagrid works, when I select a row in the datagrid nothing happens in the input field.
    I added also form_type and grid_name to my entity config.
    Do you have any suggestion?
    thanks
    Ale

    search.yml

    service.yml

Viewing 2 replies - 1 through 2 (of 2 total)

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top