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

tabs does not update

Thread ID:

Created:

Updated:

Platform:

Replies:

148855 Nov 6,2019 12:44 PM UTC Nov 7,2019 01:19 PM UTC Blazor 1
loading
Tags: Tabs
ebi torabi
Asked On November 6, 2019 12:44 PM UTC

Hi.
I want to display a  tab if I check and do not display if i Uncheck .


@page "/"
<EjsTab @ref="sourceTab" CssClass="e-fill" EnableRtl="true" OverflowMode="OverflowMode.Scrollable" HeightAdjustMode="HeightStyles.None" Height="390px" ShowCloseButton="false">
    <TabEvents></TabEvents>
    <TabItems @ref="@TabItems1">

        <TabItem @ref="@a">
            <ChildContent>
                <TabHeader Text="aaaaaaa"></TabHeader>
            </ChildContent>

            <ContentTemplate>
                <div class="btn-container">
                    <EjsCheckBox EnableRtl="true" Label="همه اطلاعات بالا مورد تاییدم است." @bind-Checked="IsAccepted"></EjsCheckBox>
                </div>
            </ContentTemplate>
        </TabItem>
        @if(IsAccepted )
        { 
        <TabItem @ref="@b">
            <ChildContent>
                <TabHeader Text="bbbbbbbbb"></TabHeader>
            </ChildContent>

            <ContentTemplate>
                <p>bbbbb</p>
            </ContentTemplate>
        </TabItem>
        }
        <TabItem @ref="@c">
            <ChildContent>
                <TabHeader Text="cccccccccccc"></TabHeader>
            </ChildContent>

            <ContentTemplate>
                <p>cccccccccccccc</p>
            </ContentTemplate>
        </TabItem>

    </TabItems>
</EjsTab>
  EjsTab sourceTab;
    TabItem a ;
    TabItem b;
    TabItem c;
    bool IsAccepted =false;
}

Attachment: tabUpdate_2fd2ef00.rar

Nevitha Ravi [Syncfusion]
Replied On November 7, 2019 01:19 PM UTC

Hi Ebi, 

Greetings from Syncfusion Support. 

We have checked the case at our end, since we could not add or remove the tab items based on the condition provided in the shared code we suggest you to use Disabled property using which we can dynamically enable or disable a tab item based on the conditions. Also, currently we have a breaking issue to use Disabled property that will work on our 17.3.17 ej2.min.js file. We will include the issue fix in our upcoming patch release expected to be rolled out in the mid of November 2019. You can keep track of the issue form the following link. 

Meanwhile we suggest you to use our 17.3.17 CDN links and for the same we have shared a sample for your reference that can be downloaded from the following link. 

<EjsTab @ref="sourceTab" CssClass="e-fill" EnableRtl="true" OverflowMode="OverflowMode.Scrollable" HeightAdjustMode="HeightStyles.None" Height="390px" ShowCloseButton="false"> 
    <TabEvents></TabEvents> 
    <TabItems @ref="@TabItems1"> 
        <TabItem @ref="@a"> 
            <ChildContent> 
                <TabHeader Text="aaaaaaa"></TabHeader> 
            </ChildContent> 
            <ContentTemplate> 
                <div class="btn-container"> 
                    <EjsCheckBox EnableRtl="true" Label="همه اطلاعات بالا مورد تاییدم است." @bind-Checked="IsAccepted"></EjsCheckBox> 
                </div> 
            </ContentTemplate> 
        </TabItem> 
            <TabItem Disabled="IsAccepted" @ref="@b"> 
                <ChildContent> 
                    <TabHeader Text="bbbbbbbbb"></TabHeader> 
                </ChildContent> 
                <ContentTemplate> 
                    <p>bbbbb</p> 
                </ContentTemplate> 
            </TabItem> 
        <TabItem @ref="@c"> 
            <ChildContent> 
                <TabHeader Text="cccccccccccc"></TabHeader> 
            </ChildContent> 
            <ContentTemplate> 
                <p>cccccccccccccc</p> 
            </ContentTemplate> 
        </TabItem> 
    </TabItems> 
</EjsTab> 
 
@code{ 
    EjsTab sourceTab; 
    TabItem a; 
    TabItem b; 
    TabItem c; 
    bool IsAccepted = true; 
} 

Kindly try the suggested solution and get back to us if you have any further queries. 

Regards, 
Nevitha. 


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