Adding Telerik Datepicker to Dynamically added form fields
I have a scenario where I开发者_运维百科 have to dynamically add fields on the page through JavaScript.
How can I apply telerik datepicker to dynamically added fields?
I'm using telerik extensions for ASP.net MVC 3.
You can try this (make sure the required javascript files are included):
$("<input />").appendTo(document.body).tDatePicker();
You can try this for creating a DatePicker
dynamically
var dp = @Html.Telerik().DatePicker().Name("DateCreated").InputHtmlAttributes(new { @class = "FilterDatePicker" });
$("#body").append(dp);
$('.FilterDatePicker').tDatePicker();
精彩评论