invalid argument error when adding dynamic raddock

2 posts, 0 answers
  1. Jed Horovitz
    Jed Horovitz avatar
    19 posts
    Member since:
    Oct 2007

    Posted 03 Aug 2009 Link to this post

    I have a page based on the raddock example for storing raddock state into a database.
    This has been working since Promethius but is raising an error "invalid argument" javascript exception at the line "_85.style.zIndex=this.originalZIndex;" every time I add a rad dock to the RadDockZone using the Q1 2009. 

    I can't try q2 2009 because that is causing another error that I need to post.

    Any help would be appreciated.

    B


  2. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 06 Aug 2009 Link to this post

    Hello Jed,

    I think what might be causing the problem is that the originalZindex property of the RadDock is not initialized when the dock is added to the page and that's why JavaScript error is thrown. This however is fixed in the latest version of our controls and you can upgrade to it if you want.

    To workaround this problem you can initialize the zIndex by adding the following code in the event handler method of the Button (Add Dock) Click event:

    protected void ButtonAddDock_Click(object sender, EventArgs e) 
                RadDock dock = CreateRadDock(); 
                //In order to optimize the execution speed we are adding the dock to a  
                // hidden update panel and then register a script which will move it 
                // to RadDockZone1 after the AJAX request completes. If you want to  
                // dock the control in other zone, modify the script according your needs. 
                UpdatePanel1.ContentTemplateContainer.Controls.Add(dock); 
                 
                //// This line is added $find('{0}').originalZIndex = '';  
                ScriptManager.RegisterStartupScript( 
                dock, 
                this.GetType(), 
                "AddDock"
                string.Format(@"function _addDock() {{
        Sys.Application.remove_load(_addDock);
        $find('{0}').originalZIndex = ''; 
        $find('{1}').dock($find('{0}'));
        $find('{0}').doPostBack('DockPositionChanged');
    }};
    Sys.Application.add_load(_addDock);", dock.ClientID, DropDownZone.SelectedValue), 
                true); 
     
                //Right now the RadDock control is not docked. When we try to save its state 
                // later, the DockZoneID will be empty. To workaround this problem we will  
                // set the AutoPostBack property of the RadDock control to true and will  
                // attach an AsyncPostBackTrigger for the DockPositionChanged client-side 
                // event. This will initiate second AJAX request in order to save the state 
                // AFTER the dock was docked in RadDockZone1. 
                CreateSaveStateTrigger(dock); 
     
                //Load the selected widget in the RadDock control 
                dock.Tag = DroptDownWidget.SelectedValue; 
                LoadWidget(dock); 
     
    In case this does not fix the problem, please send us more information on which example exactly is your application based (because there are some modifications in the RadDock example SaveState in DB).



    Greetings,
    Pero
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top