$(function() {
$("#allRecord").on("click", ".editUser", function() {
$(this).toggleClass('fa-edit fa-check');
$(this).toggleClass('editUser confirmEditUser');
for(i=0; i<$("td", $(this).parent().parent()).length-1;i++)
{
j= $($("td", $(this).parent().parent())[i]);
j.html('');
}
});
$("#allRecord").on("click", ".confirmEditUser", function() {
function callBackVerif(data){
var dataToSend = new Object();
dataToSend["updatePW"] = (data===true?false:true);
if($(".pw input", tr).val() === data || data === true)
{
for(i=0; i"+e , "error" );
}
console.log(data.return)
}, "json");
}
else {
swal( "Oops" , "Password don't match !" , "error" );
}
}
tds = $("td", $(this).parent().parent());
tr = $(this).parent().parent();
that = this;
if ($(".pw input", tr).val() === "") {
swal("no pw update");
callBackVerif(true);
}
else {
swal({
closeOnClickOutside: false,
closeOnEsc: false,
content: {
element: "input",
attributes: {
placeholder: "Confirmer le mot de passe",
type: "password",
},
},
}).then(callBackVerif);
}
});
});
function ltrim(str) {
if(str == null) return str;
return str.replace(/^\s+/g, '');
}