Twitter bootstrap 如何读取引导确认确定/取消事件?
我正在开发MVC应用程序。 我正在为CSS使用bootstrp 我正在使用alert/dialog确认删除记录。 但是对于如何读取用户对OK或cancel的响应感到困惑Twitter bootstrap 如何读取引导确认确定/取消事件?,twitter-bootstrap,Twitter Bootstrap,我正在开发MVC应用程序。 我正在为CSS使用bootstrp 我正在使用alert/dialog确认删除记录。 但是对于如何读取用户对OK或cancel的响应感到困惑 var href = $(this).attr('href'); if (!$('#dataConfirmModal').length) { $('body').append('<div id="dataConfirmModal" class="modal" role="dialo
var href = $(this).attr('href');
if (!$('#dataConfirmModal').length) {
$('body').append('<div id="dataConfirmModal" class="modal" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h6 id="dataConfirmLabel">Deactivation Confirmation</h6></div><div class="modal-body">Are you sure to deactive @Model.Name ? </div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button><a class="btn btn-primary" id="dataConfirmOK">OK</a></div></div>');
}
$('#dataConfirmModal').find('.modal-body').text($(this).attr('data-confirm'));
$('#dataConfirmOK').attr('href', href);
$('#dataConfirmModal').modal({show:true});
return false;
顺便问一下,你试过使用引导程序吗
我将给您一个示例代码:
bootbox.confirm("Are you sure?", function(result) {
if (result)
{
Example.show("You press Ok");
}
else
{
Example.show("You press Cancel");
}
});
就我个人而言,我在每个模式按钮上使用click事件来执行我想要的操作 我不认为有模态发送的结果,正如我们在其他语言中看到的那样