2013-08-23 37 views
0

我試着劍道日期選擇器自定義模板。
我想在這裏設置日期的名稱是劍道模板的演示。
http://demos.kendoui.com/web/datepicker/template.html
,這裏是出生日期劍道日期選擇器模板集名稱與b'date

birthdays = [ 
          new Date(today.getFullYear(), today.getMonth(), 11), 
          new Date(today.getFullYear(), today.getMonth() + 1, 6), 
          new Date(today.getFullYear(), today.getMonth() + 1, 27), 
          new Date(today.getFullYear(), today.getMonth() - 1, 3), 
          new Date(today.getFullYear(), today.getMonth() - 2, 22), 
          new Date(today.getFullYear(), today.getMonth(), 23) 
         ]; 

在這裏,我要設置名稱與b'date像11月設置名稱赤岸。
並在鼠標懸停顯示此名稱。
任何想法我怎麼能做到這一點。
謝謝。

回答

1

我想,你也可以這樣做。你必須爲此準備JSON。你想這樣做。

birthdays = [ 
    new Date(today.getFullYear(), today.getMonth(), 11, 'Frnd1'), 
    new Date(today.getFullYear(), today.getMonth() + 1, 6, 'Frnd2'), 
    new Date(today.getFullYear(), today.getMonth() + 1, 27, 'Frnd3'), 
    new Date(today.getFullYear(), today.getMonth() - 1, 3, 'Frnd4'), 
    new Date(today.getFullYear(), today.getMonth() - 2, 22, 'Frnd5'), 
    new Date(today.getFullYear(), today.getMonth(), 23, 'Frnd6') 
]; 

其實,你所看到的文本是它的父<a>標籤由於title屬性。

您可以在JSON對象中包含生日夥伴的名字,然後您可以通過以下代碼更改其父母的名字<a>的標題。

$('.birthday').find(function(){ 
    $(this).parent().attr('title', #=data.name #'); 
});