I have some code that attaches to the click event of a class:
$(".filter-link").click(function (e) {
$("#filter").dialog("option", "position",
{ my: "left top", at: "left bottom", of: e });
$("#filter").dialog("open");
});
The element I use it on is dynamically recreated often:
function addTopLinks() {
$('#calendar .fc-view thead th.fc-resourceName')
.removeClass('top-calendar-cell');
$('#calendar .fc-view thead th.fc-resourceName')
.addClass('top-calendar-cell');
$('#calendar .fc-view thead th.fc-resourceName')
.html('<a class="filter-link" href="#">Filter Resources</a>');
};
Is there any way I can get the click to persist or will I be forced to reassign the click every time I recreate the element?
Thanks