ブートストラップモーダル内の「削除」クラスのリンクまたはボタンに削除確認メッセージを作成する関数を作成しようとしています。私は現在、通常の確認ダイアログを作成するためのこのコードを持っています:
'init_confirm_delete' : function(){
$('a.delete,button.delete').live('click',function(e){
return confirm('Are you sure you want to delete this?');
e.preventDefault();
});
},
それはうまくいきます。以下は、ブートストラップ UI を統合しようとする新しいコードです。
'init_confirm_delete' : function(){
$('a.delete,button.delete').click(function () {
$('#delete-confirm').dialog('open');
return false;
});
$("delete-confirm").dialog({
autoOpen: false,
modal: true,
buttons: {
Ok: function () {
$(this).dialog("Delete");
},
}
})
},
仲間のコーダーのアイデアはありますか?