その場でDOMに追加されたテーブル行にAJAX呼び出しを介してコンテンツをロードしています。コールバック関数で日付ピッカー機能を呼び出していますが、カレンダーは正常に表示されます。ただし、日付をクリックすると、エラーが表示されます: inst is null. これが私のコードです:
$(document).ready(function() {
$(".edit").live("click", function() {
//Delete previously loaded edit row
$("#tempEditRow").remove();
//Get the record id of the row to be edited
var recordID = $(this).parent("td").parent("tr").attr("id");
//Add the new row to the document
$(this).parent("td").parent("tr").after("<tr id=\"tempEditRow\"><td id=\"tempEditCell\" colspan=\"100\"></td></tr>")
//Get a reference to the new row
var container = $("#tempEditCell");
//Populate the container
populateContainer("/wpm/includes/ajax_editApplication.cfm?id=" + recordID, container);
});
});
function populateContainer(ajaxUrl, container) {
//Populate the container
$.ajax({
url: ajaxUrl,
cache: false,
success: function(html){
$(container).html(html);
$('.datepicker').datepicker();
}
});
}
hasDatepicker クラスの削除、datepicker への参照の削除などを試みましたが、何も機能していません。助けてくれてありがとう!