[CLOSED] One to Many gridpanel in looping

  1. #1

    [CLOSED] One to Many gridpanel in looping

    Hi!

    I'm looping problem working with the dynamic creation of the type GridPanel One to Many. I made based on the example provided by Baidaly via the link:

    http://forums.ext.net/showthread.php...l=1#post102925

    In grid parent I programmed in RowSelectionModel property Listeners.Select.Handler:

       var r = new RowSelectionModel();
       r.Listeners.Select.Handler = ProductGrid.ClientID + ".store.load({ params: { tid: this.getSelection()[0].data.ID } });";
       StopGrid.SelectionModel.Add(r);
    In grid child I programmed a proxy for running a store DirectMethod:

                    new Store 
                    { 
                        AutoLoad = false,
                        Model = {
                            new Ext.Net.Model {
                                IDProperty = "ID",
                                Fields = 
                                {
                                    new ModelField("ID"),
                                    new ModelField("Name")
                                }
                            }
                        },
                        Proxy =
                            {
                                new PageProxy()
                                    {
                                        DirectFn = "App.direct.LoadProductData",
                                        Reader =
                                            {
                                                new ArrayReader()
                                            }
                                    }
                            }
                    }
    The grids are typically created in the Page_Load event. When I click the first time on a row of grid parent page is looping always running DirectMethod charging grid child. Thus it is not possible to manipulate the data grid child.

    Using the artifice described by Baidaly in Page_Load the problem is solved but the rest stops working (editing the grid, editable header, etc..).

    protected void Page_Load(object sender, EventArgs e)
        {
            if (X.IsAjaxRequest)
            {
                //We do not need to DataBind on an DirectEvent
                return;
            }
        }
    How to solve this problem?

    Thanks!

    Ermanni
    Last edited by Baidaly; Aug 01, 2013 at 2:05 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Can you provide full sample to investigate your issue?
  3. #3
  4. #4
    Try to replace the following at the end of Page_Load:

    ReadStore();
    with this one:

    if (!X.IsAjaxRequest)
        ReadStore();
  5. #5
    Hi Baidaly!

    The problem was solved with the proposed solution. But now I have another case: modified "gridProd" to be editable by setting the event StoreProd.BeforeStoreChanged.

    After editing a column of "gridProd" event LoadProdData runs with the parameter action = "update" and no values ​​for extraParams. Finally StoreProd.BeforeStoreChanged the event does not run.

    When "gridProd" reloads the data entered are lost.

    How to solve this case? Because the event BeforeStoreChanged was not executed?

    Thanks!

    Ermanni
  6. #6
    Hi,

    A Store's OnBeforeStoreChanged event should be used only if no Proxy. In your case there is a PageProxy. It is why the OnBeforeStoreChanged event doesn't fire.

    So, saving/synchronization should be done via the PageProxy as well.
  7. #7
    Hi Daniil!

    Got it. We have an example of how to record through PageProxy. In parameter "action" noted that the property receives the value "update" but as I will have access to information that has changed?

    In the event OnBeforeStoreChanged I have a list of rows and columns with the current values ​​of GridPanel. In PageProxy these values ​​also exist?

    Thanks!

    Ermanni
  8. #8
    Yes, an updated record (-s) will be in the "serviceParams" parameter.
  9. #9
    Hi Daniil!

    Perfect! All working now!

    Thanks!

    Ermanni

Similar Threads

  1. [CLOSED] Looping through a gridpanel
    By Tonic in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 12, 2013, 7:35 AM
  2. Infinite looping with search
    By stonegate in forum 2.x Help
    Replies: 1
    Last Post: Oct 29, 2012, 12:28 PM
  3. [CLOSED] [1.0] Looping through FormPanel fields
    By danielg in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 08, 2010, 7:42 AM

Tags for this Thread

Posting Permissions