OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions make link in custom datagrid

This topic contains 12 replies, has 2 voices, and was last updated by  fred33 8 years, 1 month ago.

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

  • Creator
    Topic
  • #28816

    fred33
    Participant

    Hi
    I created a entete order datagrid and I would like when I click on the line bring up a new screen showing the details of selected entete order… How can i do this ??

    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Author
    Replies
  • #28817

    Yevhen Shyshkin
    Participant

    Hello.

    You need to have row action that leads to page with order details, and then you should mark this action as default row action.

    #28818

    fred33
    Participant

    Ok that’s what i’m trying to test, let me explain what i did:
    I have a entetecde entity with datagrig in src/CL/Bundle/entetecde/Resources/config/
    i have a detailcde entity whith datagrid in src/CL/Bundle/detailcde/Resources/config/
    in my entetecde datagrid i did this

    correct or not ??
    and how do i built my query select in detailcde datagrid to retrieve the id parameter of entetecde datagrid

    Thanks

    #28819

    Yevhen Shyshkin
    Participant

    > correct or not ??
    You need to specify route name that leads to the specific page, not the template of this page. So, instead of route: CL\Bundle\DetailCdeBundle\views\Default\inde you should put there route name.

    > and how do i built my query select in detailcde datagrid to retrieve the id parameter of entetecde datagrid
    If I understand you correctly you want to open view or edit page of some entity (detailcde?) from grid that shows these entities. In this case you don’t need to use enother entity grids – just make sure that you have entity identifier in query and in properties.

    #28820

    fred33
    Participant

    sorry i don’t understand your solution…
    the user can see his client entetecde if they wish by selecting the line bring up the detail of the order
    entetecde datagrid
    client/ libelle client/ numero_cde/ CAHT/ …….

    detailcde datagrig
    numero_cde/ client/ article/ qte/ CAHT_ligne/ ………

    that’s what i have

    thanks

    #28821

    Yevhen Shyshkin
    Participant

    Could you clarify your question? Do you want to open another page with a details of a selected line? Or do you want to open a popup with additional grid? Or do you want just redirect to another grid with applied filters? Or do you want to render grid inside a grid row?

    #28822

    fred33
    Participant

    sorry i think i should start with that. I want to test 2 solutions :
    redirect to another grid with applied filters and render grid inside a grid
    becaufe the user might want to see the detail of several orders

    thanks

    #28823

    Yevhen Shyshkin
    Participant

    > redirect to another grid with applied filters
    In this case you have redirect to a page with applied filters. First way to do that – create custom property (e.g. extended from UrlProperty) and generate URL with applied filters there. Second way – pass entity identifier parameter to URL using regular “url” property and then apply filters on ending page.

    > render grid inside a grid
    Unfortunately, you can’t do that out of the box. First solution – you can listen to “clicked” row action and render related grid after a grid row there (related grid can be prerendered and passed to UI as property). Second solution – you can add separate twig column with row details – e.g by default it might contain only link “Show details”, and after clicking it will be replaced with related grid.

    #28824

    fred33
    Participant

    OK all this solutions are not very simple, I did not understand half of what you said ;), finally what is the simplest solution is put in place ?

    Thanks

    #28825

    Yevhen Shyshkin
    Participant

    > you can add separate twig column with row details – e.g by default it might contain only link “Show details”, and after clicking it will be replaced with related grid

    If you want to grid inside a grid – this is the simplest one – you just need to add template for main grid column and render related grid there.

    Alternative easy solution – you can create small page to render details grid and redirect to it on row click (like a view page for entity).

    #28826

    fred33
    Participant

    > Alternative easy solution – you can create small page to render details grid and redirect to it on row click (like a view page for entity).

    That’s what i want…

    #28827

    Yevhen Shyshkin
    Participant

    1) Create controller action that receives required parameters (identifier of an entity)
    2) Create template for this controller that renders required information (grid with details)
    3) Add route to this controller action, make sure page rendered correctly on UI
    4) Add property (with controller route) and action at main entity grid, mark action with rowAction: true

    See any entity grid (e.g. Users grid) for example.

    #28828

    fred33
    Participant

    an example without trying too hard to abuse
    and I stop ask betes issues

    Thanks a lot for your help

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

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

Back to top