jquery
  • asp.net-mvc
  • kendo-ui
  • 2014-11-25 52 views 0 likes 
    0

    我有一個動態生成的kendo accordion面板內的輸入列表。Kendo Datepicker z index

    的輸入是這樣產生的:

    rowContent += "<td><input " + checked + " class='" + field.FieldTypeInput + "' type='" + field.FieldTypeInput + "' id='FldList_" + rowLength + "__UpdatedValue' value='" + currentValue + "' name='FldList[" + rowLength + "].UpdatedValue' ></td>"; 
    

    而這些輸入是被變成劍道日期選取器日期:

    $('.datepicker').kendoDatePicker({ 
    
    }); 
    

    我現在面臨的問題是日期彈出窗口出現在面板下方(或者任何在裏面的東西)

    我試過這個:

    $('.datepicker').kendoDatePicker({ 
        //comment the beforeShow handler if you want to see the ugly overlay 
        open: function() { 
         setTimeout(function() { 
          $('.ui-datepicker').css('z-index', 8888); 
         }, 1); 
        } 
    }); 
    

    如果我通過調用 $('。datepicker').bob來破壞scipt,它會中斷腳本並因此起作用(但顯然也會打破其餘的javascript功能。

    我也試過這樣:

    $("input[type=date]").kendoDatePicker({ 
        open:function(e) 
         {     
          window.setTimeout(function(){ $(".k-calendar-container").parent(".k-animation-container").css("zIndex", "11000"); }, 1); 
         } 
        }); 
    

    我自己也嘗試改變風格:

    position: relative; z-index: 100000; 
    

    現在我完全沒了主意。

    有人能幫我嗎?

    非常感謝

    編輯:

    我注意到,我使用jQuery的功能不會出現在所有設置Z-指數。我試圖改變$('。ui-datepicker')。css('z-index',8888);到$('。k-calendar-container')。css('z-index',8888);但那也沒用。我會不斷更新,因爲我覺得更多信息

    +0

    你能不能做反向,並嘗試在面板上降低z-index的? – 2014-11-25 12:48:16

    +0

    根據Firebug的面板只有一個z-索引爲5.所以不應妨礙。 我想知道如果這是溢出問題,但更改溢出不幫助(最好它在該面板上創建一個滾動條) – 2014-11-25 14:05:37

    +0

    好的。那麼你還可以在FireBug的datepicker日曆下拉列表中設置z-index,這樣做有幫助嗎?劍道的複雜性是嵌套元素的各種層次結構... – 2014-11-25 16:02:48

    回答

    0

    嘗試關閉日期選擇動畫,看看是否有幫助:

    $('.datepicker').kendoDatePicker({ 
        //comment the beforeShow handler if you want to see the ugly overlay 
        open: function() { 
         $('.ui-datepicker').css('z-index', 8888); 
        }, 
        animation: { 
         open: { 
          duration: 0 
         } 
        } 
    }); 
    
    +0

    感謝您的回答,但這並不奏效。我剛剛注意到這個函數實際上並沒有設置容器的z-Index。 – 2014-11-26 10:44:36

    相關問題