We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

It's possible Jquery hide toolbar or disable toolbar items

Hi

It's possible Jquery hide toolbar or disable toolbar items ( add,edit,delete,update,cancel)

  <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>


Thanks

Pratheep



3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team January 9, 2017 12:58 PM UTC

Hi Pratheep, 

Thanks for contacting Syncfusion support. 

Yes, it is possible to hide the toolbarItems in grid. In this sample at initial rendering we get the toolbar instance and  hide the toolbarItems using hide method of ejToolbar.  

Find the code example and sample:  


<asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    <ej:Grid ID="Grid" runat="server" AllowPaging="True" AllowResizing="true"> 
        <Columns> 
               ------------------------------------ 
           </Columns> 
          <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"></EditSettings> 
          <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> 
           
        </ej:Grid>  
 
<script type="text/javascript"> 
    $(function () { 
        var toolbar1 = $('#<%= Grid.ClientID + "_toolbarItems" %>').data("ejToolbar"); 
        $(toolbar1.items).hide(); 
    }); 
</script> 


Refer to the Help document of hide method. 

  
If you need to hide the particular toolbar item , use below code example: 
 
 
<script type="text/javascript"> 
    $(function () { 
        var toolbar1 = $('#<%= Grid.ClientID + "_toolbarItems" %>').data("ejToolbar"); 
        $(toolbar1.items[0]).hide(); 
    }); 
</script> 
 
 
Regards, 
Prasanna Kumar N.S.V 
 



PR Pratheep January 9, 2017 08:12 PM UTC

Hi Prasanna 

Thank you for your support.Working fine

Thanks
Pratheep


TS Thavasianand Sankaranarayanan Syncfusion Team January 10, 2017 12:01 PM UTC

Hi Pratheep, 
 
We are happy that the problem has been solved. 
Please get back to us if you need any further assistance.  
 
Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon