0
我嘗試在視圖中添加動態標籤。我想用一個jQuery插件作爲datetimepicker。 (http://xdsoft.net/jqplugins/datetimepicker/) 這不起作用。動態添加標籤無法正確使用datepicker
//$("#timeseriesDate" + i + "").datetimepicker({
// timepicker: false,
// format: 'Y/m/d',
// formatDate: 'Y/m/d'
//});
function create() {
var startDate = new Date($('#date1').val());
var endDate = new Date($('#date2').val());
var diff = datediff(startDate, endDate);
$("#matrixtimeseries").empty();
$("#matrixtimeseries").append('<div>');
for (i = 0; i < diff; i++) {
$("#matrixtimeseries").append('<input class="timeseries-red date" type="text" name=timeseriesDate' + i + 'id=timeseriesDate' + i + '"/>');
//$("#timeseriesDate" + i + "").datetimepicker({
// timepicker: false,
// format: 'Y/m/d',
// formatDate: 'Y/m/d'
//});
for (var ii = 0; ii < 24; ii++) {
$("#matrixtimeseries").append('<input class="timeseries-red" type="text" name=hourseries' + i + ii + 'id=hourseries' + i + ii + '" />');
}
$("#matrixtimeseries").append('<br/>');
};
$("#matrixtimeseries").append('</div>');
}
謝謝巴爾瑪。 – ayse