This is a migrated thread and some comments may be shown as answers.

Client-side disabling of the entire toolbar

3 Answers 116 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Joseph Alfano
Top achievements
Rank 1
Joseph Alfano asked on 31 Mar 2010, 03:12 PM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Apr 2010, 06:59 AM

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.

0
Vincent
Top achievements
Rank 1
answered on 18 Apr 2010, 01:23 PM
Hi Shinu

the code your provide is not working.
0
Vincent
Top achievements
Rank 1
answered on 18 Apr 2010, 01:36 PM
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++; 
        } 
    } 
 

Tags
ToolBar
Asked by
Joseph Alfano
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Vincent
Top achievements
Rank 1
Share this question
or