OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Refresh multiple datagrids in one event

This topic contains 4 replies, has 2 voices, and was last updated by  Hryhorii Hrebiniuk 8 years, 2 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
  • #34034

    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
  • #34035

    Hryhorii Hrebiniuk
    Participant

    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.

    #34036

    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.

    #34037

    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!

    #34038

    Hryhorii Hrebiniuk
    Participant

    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)

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

Back to top