kendo日期选择器模板设置名称与b'date

时间:2013-08-23 13:26:11

标签: datepicker kendo-ui

我正在尝试kendo日期选择器自定义模板 我想在这里设置日期名称是剑道模板的演示 http://demos.kendoui.com/web/datepicker/template.html
这是出生日期

 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月8日设置Name Chian。
并在鼠标上显示此名称 我怎么能这样做呢 谢谢。

1 个答案:

答案 0 :(得分: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')
];

实际上,您看到的文字归因于其父title标记的<a>属性。

您可以在JSON对象中包含生日人的姓名,然后您可以通过以下代码更改其父<a>的标题。

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