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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Conditional show/hide toolbar items

Thread ID:

Created:

Updated:

Platform:

Replies:

150746 Jan 17,2020 09:56 PM UTC Feb 6,2020 10:04 AM UTC Blazor 2
loading
Tags: Toolbar
Waleed
Asked On January 17, 2020 09:56 PM UTC

I am trying to show/hide toolbar items based on value like this :

  <EjsToolbar>
        <ToolbarItems>
            @if (myMode == MyEditMode.None)
            {
                <ToolbarItem OnClick="AddClick" Text="Add New" PrefixIcon="em-icons e-copy" TooltipText="Paste"></ToolbarItem>
                @if (CurrentEntity != null)
                {
                    <ToolbarItem OnClick="EditClick" Text="Edit" PrefixIcon="em-icons e-edit"></ToolbarItem>
                    <ToolbarItem Type="@ItemType.Separator"></ToolbarItem>
                    <ToolbarItem OnClick="EditClick" Text="Delete" PrefixIcon="em-icons e-edit"></ToolbarItem>
                }
            }
            </ToolbarItems>
        </EjsToolbar>

but unfortunatly it is not working .
Do you have suggestions acheiving this ?

Alagumeena Kalaiselvan [Syncfusion]
Replied On January 20, 2020 12:47 PM UTC

Hi Waleed, 

Greetings from Syncfusion Support! 

Currently, the requirement “show/hide the toolbar item based on conditional” is not feasible with toolbar. We will consider your requirement as improvement in our end and provide API to show or hide the tab items.   

You can keep track and update your comments in the following feedback link.  

We have planned to include this improvement feature in 2020 Volume 1 main release, which is planned to roll-out on end of March 2020. We would appreciate your patience until then.  

Regards 
Alagumeena.K

Alagumeena Kalaiselvan [Syncfusion]
Replied On February 6, 2020 10:04 AM UTC

Hi Waleed, 

We are glad to inform that your feature request “Provide API to show/hide Toolbar item” has been implemented and included in our latest release version V17.4.47. Refer below release notes for that 

Also, we have prepared a sample based on your requirement and refer the below code 

@using Syncfusion.EJ2.Blazor.Navigations 
 
<button @onclick="OnClick">Show/Hide</button> 
<EjsToolbar> 
    <ToolbarItems> 
        <ToolbarItem Text="Cut" Visible="@IsVisible"></ToolbarItem> 
        <ToolbarItem Text="Copy"></ToolbarItem> 
        <ToolbarItem Text="Paste"></ToolbarItem> 
        <ToolbarItem Text="Test"></ToolbarItem> 
    </ToolbarItems> 
</EjsToolbar> 
 
@code{ 
    public bool IsVisible = true; 
    public void OnClick() 
    { 
       IsVisible = !IsVisible; 
    } 
} 

  • In above sample, the show/hide customization of toolbar items handled by “Visible” property and you can show/hide the tab item by clicking the “Show/Hide” button .

Kindly get back to us, If you need further assistance. 

Regards 
Alagumeena.K 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon