JSFiddle - React, Tailwind, and code Playground
by Fantasy Land
JavaScript
$(document).ready(function() {
function fnOpenNormalDialog() {
$("#dialog-confirm").html("This Contract is locked by other user, Please choose a different Contract #");
// Define the Dialog and its properties.
$("#dialog-confirm").dialog({
resizable: false,
modal: false,
//title: "Delete Confirmation",
height: 250,
width: 400,
buttons: {
"Yes": function () {
$(this).dialog('close');
$.ajax({
url: "<s:url var='contractDetailsUrl' action='concurrentLockFunction'/>", //servlet URL that gets first option as parameter and returns JSON of to-be-populated options
type: "POST",//request type, can be GET
data: $("#invdeleteFormId").serialize()
}).done(function(msg) {
$("#invdeleteFormId").html(msg);
});
},
"No": function () {
$(this).dialog('close');
callback(false);
}
}
}).prev().find(".ui-dialog-titlebar-close").hide ();
}
$('#testContract').click(fnOpenNormalDialog);
function callback(value) {
if (value) {
$("#delConfirm").val('true');
//alert("cofirm box value......"+$("#confirmBox").val());
if ($("#lockFundUser").val()){
//alert("Deleting now..alert");
//optional....
$("#dialog-confirm").html("Deleting now...");
$("#dialog-confirm").dialog({
resizable: false,
modal: false,
height: 250,
width: 400,
buttons: {
"Ok": function () {
$(this).dialog('close');
$.ajax({
url: "<s:url var='contractDetailsUrl' action='concurrentLockFunction'/>",
type: "POST", data: $("#invdeleteFormId").serialize()
}).done(function(msg) {
$("#invdeleteFormId").html(msg);
});
},
"Cancel": function ()...