[CLOSED] Save Gridpanel on server-side

  1. #1

    [CLOSED] Save Gridpanel on server-side



    Hello,

    I have an <ext:Window> control that contains Employee information, this information is saved using a Stored Proc. This window contains two other tab controls that holds one, the employee Phone numbers and the second one, employee emails. These last two are GridPanels which the user Insert/Updates on the control.
    Here is my problem, I have a method that fires the Stored Procedure for Insert/Update the main Employee info, then since I could not find a method to save the GridPanel on the Server-Side, I use the GridPanel AddScript Method (see code bellow) The window will close before I can catch the BeforeRecordInserted events of the GridPanels for the Phone and Email tabs.

    Main save method
        public void updateUser(string userSysguid, string staffid, string userId, StaffBO staff, string active)
            {
                Users usrs = new Users();
    
    
                try
                {
                    // Stored Procedure
                    usrs.updateUser(userSysguid, userId, staffid, staff, active, Session["UserNetworkName"].ToString().ToUpper());
                    
                    // Add Script to GridPanels
                    SaveGrid(this.gridPhone);
                    SaveGrid(this.gridEmail);
                    
                    // Cannot catch this flag on time
    
    
                    if (this.cancel == true)
                    {
    
    
                    }
                    else
                    {
                        this.ResetFilter();
                        this.EmployeeDetailswindow.Hide();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
    
    
            }
    Sample event for the Phone Gridpanel
    Event for the Email GridPanel is almost the same
    protected void storeStaffPhone_BeforeRecordInserted(object sender, BeforeRecordInsertedEventArgs e)
    {
        object activeValue = e.NewValues["PHONE_PRMRY_IND"];
        object phonetype = e.NewValues["PHONE_PHONE_TYPE_ID"];
        object phoneLocation = e.NewValues["PHONE_LOCTN_TYPE_ID"];
    
    
    
        if (phonetype.ToString()== "")
        {
            e.Cancel = true;
            this.cancel = true;
            this.message = "<br>* Phone Type cannot be empty.";
        }
        if (phoneLocation.ToString() == "")
        {
            e.Cancel = true;
            this.cancel = true;
            this.message += "<br>* Phone Location cannot be empty.";
        }
        
        if(this.cancel != true)
        {
    
    
            if (activeValue.ToString() == "true")
            {
                e.NewValues["PHONE_PRMRY_IND"] = "Y";
            }
            else if (activeValue.ToString() == string.Empty || activeValue.ToString() == "false")
            {
                e.NewValues["PHONE_PRMRY_IND"] = "N";
            }
        }
    }
    Any Ideas?



  2. #2

    RE: [CLOSED] Save Gridpanel on server-side

    Hi Ernesto,

    I read through your post, but unfortunately I don't have any recommendations. Can you post some more details that would enable us to better understand the problem? A full .aspx code sample would be helpful.


    See http://forums.ext.net/showthread.php...ing-New-Topics



    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Save ext:GridPanel.getState() in SQL Server database
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 03, 2012, 11:17 AM
  2. [CLOSED] Cancel insert on store's save after server side validation.
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Nov 23, 2011, 1:16 AM
  3. [CLOSED] GridPanel Server-Side Save.
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 11, 2010, 3:31 PM
  4. Server side method to save Gridpanel
    By cpvaishya in forum 1.x Help
    Replies: 0
    Last Post: Jan 27, 2010, 1:09 AM
  5. Save the GridPanel Server Side
    By egodoy in forum 1.x Help
    Replies: 0
    Last Post: May 27, 2009, 1:17 PM

Posting Permissions