Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
28754 tejbeer 1
$(function() {
2
	$(document).on('click', ".high_demand_item", function() {
3
		loadHighDemandOrder("main-content");
4
	});
5
 
6
 
7
	$(document).on('click', ".add-high-demand-item",
8
		function() {
9
			var itemQty = $('#item-qty').val();
10
			var catalogId = catalogItemId
11
			if (confirm("Are you sure you want add qty!") == true) {
12
				doPostAjaxRequestHandler(context + "/addHighDemandItem?catalogId="
13
					+ catalogId + "&qty="
14
					+ itemQty, function(response) {
15
						if (response == 'true') {
16
							alert("successfully submit");
17
 
18
							loadHighDemandOrder("main-content");
19
						}
20
 
21
						return false;
22
					});
23
			}
24
		});
25
 
26
	$(document).on('click', ".remove-hdi-model",
27
		function() {
28
			var id = $(this).data('requestid');
29
			if (confirm("Are you sure you want to remove the Item") == true) {
30
				console.log(id);
31
				doDeleteAjaxRequestHandler(context
32
					+ "/removeHighDemandItem?id=" + id,
33
					function(response) {
34
						if (response == 'true') {
35
							alert("successfully Removed");
36
							loadHighDemandOrder("main-content");
37
						}
38
 
39
					});
40
			}
41
 
42
		});
43
})
44
 
45
function loadHighDemandOrder(domId) {
46
	doGetAjaxRequestHandler(context + "/highDemandItem", function(response) {
47
		$('#' + domId).html(response);
48
	});
49
}