我有一个表,可以选择删除一行。
我的要求是,当点击Remove链接时,我需要显示一个Jquery手机弹出,是或否选项,如果点击是仅 行必须删除或不执行任何操作
你能告诉我怎么做吗??
这是我的代码
var original = $('table').html();
$('.delete').on('click', function() {
$("#itemdelpopup").popup("open");
$(this).closest('tr').children('td').addClass('deleteHighlight').animate({
padding: 0
}).wrapInner('<div />').children().slideUp(function() {
$(this).closest('tr').remove();
});
return false;
});
答案 0 :(得分:1)
我已使用有效的解决方案更新了您的jsfiddle。
我刚刚在弹出窗口的按钮中添加了ID,以便能够以这种方式捕获点击事件:
var original = $('table').html();
var clickedTD;
$('.delete').on('click', function() {
$("#itemdelpopup").popup("open");
clickedTD=$(this).closest('tr').children('td');
});
$("#yes").click(function(event){
clickedTD.addClass('deleteHighlight').animate({
padding: 0
}).wrapInner('<div />').children().slideUp(function() {
$(this).closest('tr').remove();
});
$("#itemdelpopup").popup("close");
});
$("#no").click(function(event){
alert("the user clicked NO!");
$("#itemdelpopup").popup("close");
});