OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Grid rowSelection refresh

This topic contains 9 replies, has 3 voices, and was last updated by  akhristiansen 6 years, 10 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
  • #25412

    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 4 years, 6 months ago by  Andrey Yatsenko. Reason: removed broken image url
Viewing 9 replies - 1 through 9 (of 9 total)
  • Author
    Replies
  • #25413

    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

    #25414

    Mike Kudelya
    Participant

    Hi

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

    #25415

    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.

    #25416

    zhex900
    Participant

    What do you think about using this post?

    #25417

    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 :).

    #25418

    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?

    #25419

    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.

    #25420

    zhex900
    Participant

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

    #25421

    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)

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top