简体   繁体   English

Kendo Tabstrip无法正确加载第一个选项卡

[英]Kendo Tabstrip Doesn't Load First Tab Properly

I'm currently using the new Q3 release of Kendo and am having an issue with the Kendo tabstrip control. 我目前正在使用剑道的第3季度新发行版,并且剑道的Tabstrip控件存在问题。 I have a tabstrip that has 11 tabs and the third tab navigates out of the page to a different view. 我有一个包含11个标签的标签页,第三个标签页从页面中导航到另一个视图。 From this view when I navigate back (either with breadcrumbs or through the back button on the browser), I select the third tab and refresh it's content. 从此视图中,当我向后导航时(使用面包屑或通过浏览器上的“后退”按钮),我选择了第三个选项卡并刷新其内容。 However, after this reverse page navigation the content in the first tab doesn't show when I click on it; 但是,在这种反向页面导航之后,当我单击它时,第一个选项卡中的内容不显示; all I see is a grey background in the tab. 我所看到的只是标签中的灰色背景。 When I inspect the control I can see all of the controls there with the correctly bound information. 当我检查控件时,我可以看到所有控件以及正确绑定的信息。 If I select the first tab when I navigate back to the page everything gets loaded correctly. 如果我回到页面时选择第一个选项卡,则所有内容都会正确加载。

I have no idea what is wrong or how to fix this issue. 我不知道这是什么问题或如何解决此问题。 Any help would be appreciated thanks! 任何帮助,将不胜感激,谢谢!

--EDIT-- Below is how the tabstrip is set up. -编辑-下面是设置标签栏的方式。

<div class="" id="tabstrip">
<ul>
    <li class="k-state-active">
            <i class="green icon-info-sign bigger-110"></i>
            @ResxStrings.PersonStrings.tab_juryMaster_lbl_CandidateInfo            
    </li>
    <li>            
            <i class="green icon-info-sign bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_juryMaster            
    </li>
    <li>            
            <i class="green icon-question-sign bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_eQuestion            
    </li>
    <li>
            <i class="green icon-bell bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_Events            
    </li>
    <li>            
            <i class="green icon-flag bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_Flags            
    </li>
    <li>            
            <i class="green icon-file bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_DM            
    </li>
    <li>
            <i class="green icon-calendar bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_Scheduling
    </li>
    <li>            
            <i class="green icon-money bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_Financials            
    </li>
    <li>            
            <i class="green icon-exchange bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_Merge            
    </li>
    <li>            
            <i class="green icon-suitcase bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_NameHistory            
    </li>
    <li>            
            <i class="green icon-list-ul bigger-110"></i>
            @ResxStrings.PersonStrings.tab_heading_JudgesNotes            
    </li>

</ul>
<div><div id="candidateInfo"></div></div>
<!--BEGIN juryMaster CONTENT-->
<div id="juryMaster">
    @Html.Partial("~/Views/Person/Partial_JuryMaster.cshtml")           
</div>
<!-- /juryMaster -->

<!--BEGIN eQuestion CONTENT-->
<div id="eQuestion">
    @Html.Partial("~/Views/Person/Partial_eQuestion.cshtml")

</div>
<!-- /eQuestion -->

<!-- BEGIN Events CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_Events.cshtml")
</div>
<!--/Events-->

<!-- BEGIN Flags CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_Flags.cshtml")
</div>
<!--/Flags-->

<!-- BEGIN DM CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_DM.cshtml")
</div>
<!--/DM-->

<!-- BEGIN Scheduling CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_Scheduling.cshtml")
</div>
<!--/Scheduling-->

<!-- BEGIN Financials CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_Financials.cshtml")
</div>
<!--/Financials-->

<!-- BEGIN MergeUnMerge CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_MergeUnMerge.cshtml")
</div>
<!--/MergeUnMerge-->

<!-- BEGIN NameHistory CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_NameHistory.cshtml")
</div>
<!--/NameHistory-->

<!-- BEGIN JudgesNotes CONTENT-->
<div>
    @Html.Partial("~/Views/Person/Partial_JudgesNotes.cshtml")
</div> 
<!--/JudgesNotes-->

and in the script: 并在脚本中:

        $("#tabstrip").kendoTabStrip({
        select: onSelect,
        effects: "expand:vertical",
        activate: onActivate,
        animation: false
    });

The select method gets the first tab and selects/refreshes it, and the activate method just involves grid formatting on a separate tab. select方法获取第一个选项卡并选择/刷新它,而activate方法仅涉及在单独的选项卡上进行网格格式化。 Below is the method being called when the first tab is selected 下面是选择第一个选项卡时要调用的方法

    function loadJurorSummary(jurorID) {
    $.ajax({
        url: '@Url.Content("~/Person/getPersonSummary")',
        type: "GET",
        data: { id: jurorID },
        success: function (data) {
            $("#candidateInfo").html(data);
        }
    });
}

Everything works fine on first load and navigation on the same page. 第一次加载和在同一页面上导航时,一切正常。

From the demo for ajax loaded content it appears that you need to pass in your content urls as an array in the tabstrip declaration: 演示有关ajax加载内容演示中,您似乎需要将内容URL作为数组传递给tabstrip声明:

$(document).ready(function () {
    $("#tabstrip").kendoTabStrip({
        animation: { open: { effects: "fadeIn"} },
        contentUrls: [
                    '../../content/web/tabstrip/ajax/ajaxContent1.html',
                    '../../content/web/tabstrip/ajax/ajaxContent2.html',
                    '../../content/web/tabstrip/ajax/ajaxContent3.html'
                ]
    });
});

When you go to dev tools (assuming you're using Chrome or IE) do you see any script errors in the console? 当您使用开发工具时(假设您使用的是Chrome或IE),您是否在控制台中看到任何脚本错误?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM