Results 1 to 2 of 2

Thread: Parent - Child container interaction, child action affects parent grid

  1. #1
    Sencha Premium Member
    Join Date
    Dec 2012
    Location
    Denver
    Posts
    4

    Default Parent - Child container interaction, child action affects parent grid

    Hi,
    I have a parent container that shows a grid of say cars. I have a '+' button than when pressed brings up a child container where users can add a new car. When the addition of the new car is successsful, the child container closes and then I want the grid on the parent container to refresh (showing the new car in the grid).

    What is the best way in gxt to make this happen?

    Thanks.
    Tara

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    There are many ways on how to do this but all end in that the "car model" needs to be added to the Grid's store.


    This really depends on your code and how you are doing things corrently. I would use some "CarHandler" interface that has an addCar method. Your parent widget maybe implements this (or any other controller). This reference is that added into your container that can add a new car. This why form could add the car.

    The other way round would also work. You parent container would listen until the "submit" button of the form is pressed. Once that is done, it would get the car object and add it to its own store.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •