этот работает
$("#leadTemplate").tmpl(leads).appendTo('.box-min-'+data.status+' .main_box');
$(".draggable-item").contextmenu({
'update lead': function(event, element) { location.href = '/lead/update/' + $(element).attr('id'); },
'update notes': setNotes,
'copy lead': function(event, element) { location.href = '/lead/create/' + $(element).attr('id'); }
}, 'right');
а такой нет
function contextmenu(leadsHtml) {
$(leadsHtml).find(".draggable-item").contextmenu({
'update lead': function(event, element) { location.href = '/lead/update/' + $(element).attr('id'); },
'update notes': setNotes,
'copy lead': function(event, element) { location.href = '/lead/create/' + $(element).attr('id'); }
}, 'right');
}
leadsHtml = $("#leadTemplate").tmpl(leads);
$(leadsHtml).appendTo('.box-min-'+data.status+' .main_box');
contextmenu(leadsHtml);