내가 정말로 원하는 올바른 것을 찾았습니다.
function populate_context_menu($object){
var ischecked = $($object).is(':checked');
var jsonString = JSON.stringify(values);
var ischecked = $($object).is(':checked');
if (ischecked)
{
$("#checked-a").fadeIn(200);
jQuery.ajax({
type: "POST",
url: "<?php echo base_url(); ?>" + "files/dropdown_menu",
dataType: 'json',
data: {files_ids: jsonString},
success: function (res) {
if (res)
{
$("div#result").show();
$("div#value").html(res.jsonString);
}
}
});
} else {
if (values.length === 0) {
$("#checked-a").fadeOut(200);
}
}
};
$(".selected_check").change(function() {
populate_context_menu(this);
});
바로
$('tr.check').contextmenu(function (e) {
$cb = $(this).find('input[type="checkbox"].selected_check');
$($cb).attr('checked', 'checked');
populate_context_menu($cb);
return false;
});
당신이 체크 박스에 바인딩 변경 이벤트가 있나요 클릭에 대해 이것은? 귀하의 질문에 그것을 트리거하는 방법은 무엇입니까? –
@ A.Wolff : 예, 그럴 수 있습니다. –
그러면 다음과 같이됩니다 : $ (this) .find ('input [type = "checkbox"]. check_row'). prop ('checked', true) .trigger ('change'); ' –