ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

This topic contains 9 replies, has 3 voices, and was last updated by  akhristiansen 6 months ago.

  • Creator
    Topic
  • #34735

    zhex900
    Participant

    Hi,

    I have a grid that select contact information. It works like contact-group-contacts-grid. I use a button to open a widget to render this grid. I can add and delete contact relationships using this grid. But the changes are not reflected in the grid if open the grid the second time. In another words, no matter what changes are made, the grid values remain the same.

    The changes are only rendered when I load the view page and press the grid button again.

    • This topic was modified 6 months ago by  zhex900.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #34740

    akhristiansen
    Participant

    Hello, @zhex900! Grid is not refreshing itself. When you opened widget for whe first time, without refreshing, it will be the same. If I understood your twig template correctly, you are isnitializing grid only one time, when page is loading. Because of this, grid is changing only after refreshing page.
    So you need to implement some solution to get rendered grid from back and ( with ajax, possibly) insert it to widget

    #34742
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

    You can look at the “+ Add” button on an Account Edit page as example.

    #34745

    zhex900
    Participant

    @akhristiansen, can you kindly give me a sample code of how to render grid from the back or ajax.

    @mike, I did looked at Oro/Bundle/AccountBundle/Resources/views/Account/widget/contactsInfo.html.twig
    But I cannot make much sense of it. I don’t know how to use it. My twig can add and remove row selections. I don’t understand the datagrid.listener.CallbackListener script.

    #34746

    zhex900
    Participant

    What do you think about using this post?

    • This reply was modified 6 months ago by  zhex900.
    #34748

    akhristiansen
    Participant

    This past of code will refresh datagrid. I think you can execute it when button is clicked and before widget will be shown. I wanted to post something like that, but you was first :).

    #34749

    zhex900
    Participant

    This is my first time doing this. Can you please show me how to what you said? What should I put inside this?

    #34750

    akhristiansen
    Participant

    I think code must look like that
    https://gist.github.com/Nikoblood/021734aae464bc43da8f0c84d0ae08d8

    This is just example,you need to debug it and customize to your needs.

    #34751

    zhex900
    Participant

    Do I need to run php app/console oro:requirejs:build first ?

    #34752

    akhristiansen
    Participant

    No, you need to create all valid js files, change twig templates first, and only after that run this command.

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

You must be logged in to reply to this topic.