Subversion Repositories SmartDukaan

Rev

Rev 23629 | Rev 23752 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23629 Rev 23715
Line 60... Line 60...
60
	$(".schemes-update").live('click', function() {
60
	$(".schemes-update").live('click', function() {
61
		loadSchemeUpdatePage("main-content");
61
		loadSchemeUpdatePage("main-content");
62
	});
62
	});
63
 
63
 
64
	$(".add-schemes").live('click', function() {
64
	$(".add-schemes").live('click', function() {
-
 
65
		
65
		schemeIds = $("#schemeids").val();
66
		schemeIds = $("#schemeids").val();
66
		itemIds = $("#itemids").val();
67
		itemIds = $("#itemids").val();
67
		if(itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
68
		if(itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
68
			alert("fields shouldn't be blank");
69
			alert("fields shouldn't be blank");
69
		}
70
		}
70
		updateSchemes(schemeIds, itemIds);
71
		updateSchemes(schemeIds, itemIds);
71
	});
72
	});
-
 
73
	$(".delete-schemes").live('click', function() {
-
 
74
		if(confirm("Are you sure you want to Expire Scheme!") == true){
-
 
75
		schemeIds = $("#schemeid").val();
-
 
76
		itemIds = $("#itemid").val();
-
 
77
		if(itemIds.trim().length === 0 || schemeIds.trim().length === 0) {
-
 
78
			alert("fields shouldn't be blank");
-
 
79
		}
-
 
80
		deleteScheme(schemeIds, itemIds);
-
 
81
		}
-
 
82
	});
72
});
83
});
73
 
84
 
74
function configureTagListingItemsDescriptionDropDown(){
85
function configureTagListingItemsDescriptionDropDown(){
75
	$(document).ready(function() {
86
	$(document).ready(function() {
76
        $('#tagListingItemsDescription').multiselect({
87
        $('#tagListingItemsDescription').multiselect({
Line 79... Line 90...
79
	        	buttonWidth: '180px',
90
	        	buttonWidth: '180px',
80
	        	numberDisplayed: 1,
91
	        	numberDisplayed: 1,
81
	        	nonSelectedText: 'Items',
92
	        	nonSelectedText: 'Items',
82
	        	nSelectedText: ' - Items Selected',
93
	        	nSelectedText: ' - Items Selected',
83
	        	allSelectedText: 'All Items Selected',
94
	        	allSelectedText: 'All Items Selected',
84
	        	enableFiltering: true
95
	        	enableFiltering: true,
-
 
96
	        	enableCaseInsensitiveFiltering:true
-
 
97
	        	
85
        });
98
        });
86
    });
99
    });
87
}
100
}
88
 
101
 
89
function schemesDownload(){
102
function schemesDownload(){
Line 157... Line 170...
157
	doPostAjaxRequestWithJsonHandler(context + '/schemes/update', JSON.stringify({"itemIds":itemIds.split(",").map(Number), "schemeIds":schemeIds.split(",").map(Number)}), function(response){
170
	doPostAjaxRequestWithJsonHandler(context + '/schemes/update', JSON.stringify({"itemIds":itemIds.split(",").map(Number), "schemeIds":schemeIds.split(",").map(Number)}), function(response){
158
		if(response=='true') {
171
		if(response=='true') {
159
			alert("Schemes Added successfully");
172
			alert("Schemes Added successfully");
160
		}
173
		}
161
	});
174
	});
-
 
175
}
-
 
176
function deleteScheme(shcemeIds, itemIds){
-
 
177
	doPostAjaxRequestWithJsonHandler(context + '/schemes/delete', JSON.stringify({"itemIds":itemIds.split(",").map(Number), "schemeIds":schemeIds.split(",").map(Number)}), function(response){
-
 
178
		if(response=='true') {
-
 
179
			alert("Schemes Deleted successfully");
-
 
180
		}
-
 
181
	});
162
}
182
}
163
183