任何人都可以告诉我应该如何更改ok
& Bootbox的cancel
选项yes
& no
。
function deletelaw(id) {
bootbox.confirm('Are you sure you want to delete?', function(result) {
if (result) {
$("#deletelaw_" + id).hide();
$(".law1_" + id).prop("checked", false);
var splits = $("#laws_assigned1").val().split(",");
var finalSplit = [];
for (var i = 0; i < splits.length; i++) {
if (id != splits[i]) {
finalSplit.push(splits[i]);
}
}
$("#laws_assigned1").val(finalSplit.join());
}
});
}
答案 0 :(得分:4)
您可以通过 Developer Samples - Runtime Permissions 对象来更改按钮标签和样式:
bootbox.confirm({
message: "Are you sure you want to delete?",
buttons: {
confirm: {
label: 'Yes',
className: 'btn-class-here'
},
cancel: {
label: 'No',
className: 'btn-class-here'
}
},
callback: function (result) {
if (result) {
$("#deletelaw_" + id).hide();
$(".law1_" + id).prop("checked",false);
var splits = $("#laws_assigned1").val().split(",");
var finalSplit = [];
for (var i = 0; i < splits.length; i++) {
if (id != splits[i]) {
finalSplit.push(splits[i]);
}
}
$("#laws_assigned1").val(finalSplit.join());
}
}
});
希望这有帮助。