如何隱藏MVC/Kendo UI選項卡上的單個選項卡?如何隱藏* single * MVC/Kendo tabstrip選項卡?
我想隱藏基於條件的選項卡。我的jQuery代碼是這樣的:
//authUser is a hidden input whose value is set in the controller and passed into the view
if ($('#authUser').val() == 'False') //hide the last tab
{
$($("#tabstrip").data("kendoTabStrip").items()[6]).attr("style", "display:none");
}
當我運行代碼,我得到多數民衆贊成執行的代碼行下面的錯誤,如果AUTHUSER爲False:
的JavaScript運行時錯誤:無法獲取財產「項目'未定義或空引用
想法?
如果您使用第一種方法,請確保檢查該選項卡是否被選中,如果是,請選擇另一個選項卡。如果隱藏的選項卡是活動選項卡,則內容仍將顯示在選項卡面板中,直到激活其他選項卡。 – aethercowboy