Client-side disabling of the entire toolbar

4 posts, 0 answers
  1. Joseph Alfano
    Joseph Alfano avatar
    14 posts
    Member since:
    Sep 2009

    Posted 31 Mar 2010 Link to this post

    Do you know if it is possible on the client side to disable via javascript the entire rad toolbar object directly, instead of iterating thru all of the tool bar items and disabling them one-by-one via the RadToolBarItem client object?  I did not see any appropriate methods on the RadToolBar client object API to disable the entire toolbar, but wanted to make sure I was not overlooking something. 

    Thanks for the help
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Apr 2010 Link to this post

    Hello Joseph,

    Give a try with followinig client side code in order to disable the ToolBar.

    JavaScript;

     
    <script type="text/javascript">  
        function disableToolBar() {  
            var ToolBar = $find('<%= RadToolBar1.ClientID %>');  
            ToolBar.get_element().disabled = true;  
        }  
    </script> 

    -Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 18 Apr 2010 Link to this post

    Hi Shinu

    the code your provide is not working.
  5. Vincent
    Vincent avatar
    70 posts
    Member since:
    Jul 2008

    Posted 18 Apr 2010 Link to this post

    I just create a small function which loops all items from radtoolbar and disabled/enabled all of them, it works fine. I hope someone can give more efficient solution

    Here is my solution which works fine.
        function setToolbarStatus(/*bool value indicate whether enable or disable toolbar*/ isDisabled) { 
            var toolBar = $find('<%= rdtMenu.ClientID %>'); 
     
            var toolbarItems = toolBar.get_allItems(); 
             
            var i = 0; 
            while (i < toolbarItems.length) { 
                toolbarItems[i].set_enabled(isDisabled); 
                i++; 
            } 
        } 
     

Back to Top