Rev 25736 | Rev 26284 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(function() {$('button.imeiactivations').on('click', function() {debugger;var fileSelector = $('#imeiactivations')[0];if(fileSelector != undefined && fileSelector.files[0] != undefined) {if(confirm("Confirm Upload?")) {doAjaxUploadRequestHandler(context + "/imei/upload", "POST", fileSelector.files[0], function(response){if(response) {alert("Content updated successfully");}});}} else {alert("Please upload file!");}return false;});$(".focused_model").live('click', function() {loadModel("main-content");$("#focused-model-paginated .next").live('click',function() {loadPaginatedNextItems('/getPaginatedFocusedModel', null,'focused-model-paginated', 'focused-model-table','focused-model-container');$(this).blur();});$("#focused-model-paginated .previous").live('click',function() {loadPaginatedPreviousItems('/getPaginatedFocusedModel', null,'focused-model-paginated', 'focused-model-table','focused-model-container');$(this).blur();});});$(".add-model").live('click',function() {var catalogId = itemCatalogId;var recommended = $('#recommended').val();var minimumQty = $('#minimumQuantity').val();if (catalogId === null && recommended === ""&& minimumQty === "") {alert("Field can't be empty");return;}if (recommended === "") {alert("recommended quantity is required");return;}if (minimumQty === "") {alert("minimumQty is required");return;}if (catalogId === null) {alert("please choose item");return;}var params = {"catalogId" : catalogId,"recommended" : recommended,"minimumQty" : minimumQty}if (confirm("Are you sure you want to add item!") == true) {doPostAjaxRequestWithParamsHandler(context+ "/focusedModel", params, function(response) {alert("Add Item Successfully");loadModel("main-content");});}});$(".remove-model").live('click',function() {if (confirm("Are you sure you want to Remove the Item") == true) {catalogId = $(this).data('requestid');console.log(catalogId);doDeleteAjaxRequestHandler(context+ "/removeItem?catalogId=" + catalogId,function(response) {if (response == 'true') {alert("successfully Removed");loadModel("main-content");}});}});});function loadModel(domId) {doGetAjaxRequestHandler(context + "/getFocusedModel", function(response) {$('#' + domId).html(response);});}