2013-08-23 36 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 #'); 
});