| Line 14... |
Line 14... |
| 14 |
var json = retailerDetailsJson();
|
14 |
var json = retailerDetailsJson();
|
| 15 |
console.log("retailerJson = " + json);
|
15 |
console.log("retailerJson = " + json);
|
| 16 |
if(confirm("Are you sure you want to update Retailer Details!") == true){
|
16 |
if(confirm("Are you sure you want to update Retailer Details!") == true){
|
| 17 |
doAjaxRequestWithJsonHandler(context+"/retailerDetails", "PUT", json, function(response){
|
17 |
doAjaxRequestWithJsonHandler(context+"/retailerDetails", "PUT", json, function(response){
|
| 18 |
$('#retailer-details-container').html(response);
|
18 |
$('#retailer-details-container').html(response);
|
| - |
|
19 |
if($('#retailerDocument').val() != undefined && localStorage.getItem("retailerDocument") == null){
|
| - |
|
20 |
localStorage.removeItem("retailerDocument");
|
| - |
|
21 |
}
|
| - |
|
22 |
var shopDetailsSize = $("#shopDetailsSize").attr("size");
|
| - |
|
23 |
for(var i = 0; i < shopDetailsSize; i++){
|
| - |
|
24 |
if($('#retailerShopDocument'+i).val() != undefined && localStorage.getItem("retailerShopDocument"+i) == null){
|
| - |
|
25 |
localStorage.removeItem("retailerShopDocument"+i);
|
| - |
|
26 |
}
|
| - |
|
27 |
}
|
| 19 |
});
|
28 |
});
|
| 20 |
return false; // required to block normal submit since you used ajax
|
29 |
return false; // required to block normal submit since you used ajax
|
| 21 |
}
|
30 |
}
|
| 22 |
}
|
31 |
}
|
| 23 |
});
|
32 |
});
|
| Line 468... |
Line 477... |
| 468 |
}*/
|
477 |
}*/
|
| 469 |
if(localStorage.getItem("retailerDocument") == null){
|
478 |
if(localStorage.getItem("retailerDocument") == null){
|
| 470 |
retailerDetailsObject['documentId'] = 0;
|
479 |
retailerDetailsObject['documentId'] = 0;
|
| 471 |
}else{
|
480 |
}else{
|
| 472 |
retailerDetailsObject['documentId'] = localStorage.getItem("retailerDocument");
|
481 |
retailerDetailsObject['documentId'] = localStorage.getItem("retailerDocument");
|
| 473 |
localStorage.removeItem("retailerDocument");
|
- |
|
| 474 |
}
|
482 |
}
|
| 475 |
|
483 |
|
| 476 |
//retailerDetailsObject['file'] = $('#retailerDocument')[0].files[0];
|
484 |
//retailerDetailsObject['file'] = $('#retailerDocument')[0].files[0];
|
| 477 |
var retailerAddressObject = {};
|
485 |
var retailerAddressObject = {};
|
| 478 |
retailerAddressObject['name'] = $("form#update-retailer-details-form input[name=retailerAddressName]").val();
|
486 |
retailerAddressObject['name'] = $("form#update-retailer-details-form input[name=retailerAddressName]").val();
|
| Line 504... |
Line 512... |
| 504 |
|
512 |
|
| 505 |
if(localStorage.getItem("retailerShopDocument"+i) == null){
|
513 |
if(localStorage.getItem("retailerShopDocument"+i) == null){
|
| 506 |
shopObject['documentId'] = 0;
|
514 |
shopObject['documentId'] = 0;
|
| 507 |
}else{
|
515 |
}else{
|
| 508 |
shopObject['documentId'] = localStorage.getItem("retailerShopDocument"+i);
|
516 |
shopObject['documentId'] = localStorage.getItem("retailerShopDocument"+i);
|
| 509 |
localStorage.removeItem("retailerShopDocument"+i);
|
- |
|
| 510 |
}
|
517 |
}
|
| 511 |
|
518 |
|
| 512 |
//shopObject['documentId'] = $('#retailerShopDocument'+i).attr("documentId");
|
519 |
//shopObject['documentId'] = $('#retailerShopDocument'+i).attr("documentId");
|
| 513 |
var sameAsRetailerAddress = $("form#update-retailer-details-form input[name=sameAsRetailerAddress"+i+"]").val();
|
520 |
var sameAsRetailerAddress = $("form#update-retailer-details-form input[name=sameAsRetailerAddress"+i+"]").val();
|
| 514 |
shopObject['sameAsRetailerAddress'] = (sameAsRetailerAddress == 'true');
|
521 |
shopObject['sameAsRetailerAddress'] = (sameAsRetailerAddress == 'true');
|