ssossossosso

Forums

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

This topic contains 4 replies, has 2 voices, and was last updated by Hryhorii Hrebiniuk Hryhorii Hrebiniuk 1 year, 7 months ago.

  • Creator
    Topic
  • #15807

    maurok
    Participant

    Hi,

    I have two datagrids on the same page, one is the primary and the second shows related information based on the first. If I add or delete an item from the first it refreshes the datagrid as expected, but I want the second datagrid to be refreshed as well.

    Already trid to add an array of datagrid names to reload-grid-name with no luck. Is there any way to accomplish this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #15862

    Hi,

    For now reload-grid-name option accepts only one grid name, so you can not pass a list of names there. Probably we need to improve this approach.

    But there’s workaround. Add your own grid builder module in the configuration of the main grid. This builder will be initialized once the grid is created. In the builder you can add listeners to the grid or its collection, e.g.

    Listen the event of main grid’s collection fetch and make the second grid fetch its data either.

    #15877

    maurok
    Participant

    Thanks for your response.

    Would you kindly describe the full module code required, as with your code snippet and the example in Datagrid doc I was not able to make it work. It just ignores my js class.

    #16081

    maurok
    Participant

    I was able to get it working, here’s my full code in case sombody else need it:

    Don’t forget to add the class in requirejs.yml!

    #16187

    Yes, thanks @maurok.

    First you need to extend configuration of main grid by adding own builder module. In your bundle in datagrid.yml

    And then in your module

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

You must be logged in to reply to this topic.