Subversion Repositories SmartDukaan

Rev

Rev 14520 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5185 mandeep.dh 1
$(function() {
2
    $('table#doa-items').dataTable({
14491 manish.sha 3
    	"lengthMenu": [[20, 50, 100, -1], [20, 50, 100, "All"]]
5185 mandeep.dh 4
    });
5
 
14564 manish.sha 6
    $('#doaIn_'+$(this).attr('inventoryItemId')).on('click', function(){
7
    	$('#doa-in').submit();
8
    });
9
 
10
    $('#doa-in').submit(function( event ) {
11
    	event.preventDefault();
5185 mandeep.dh 12
        $.ajax({
13
            type    : "PUT",
14
            url     : "/inventory/doa-in/" + $(this).attr('inventoryItemId'),
15
            data    : $(this).serialize(),
16
            success : function(response) {
17
                document.location.href = "/inventory/doa-in";
14564 manish.sha 18
            }
5185 mandeep.dh 19
        });
20
 
21
        return false;
14564 manish.sha 22
    });
5185 mandeep.dh 23
 
14564 manish.sha 24
    $('#doaOut_'+$(this).attr('inventoryItemId')).on('click', function(){
25
    	$('#doa-out').submit();
26
    });
27
 
28
    $('#doa-out').on('submit', function() {
5185 mandeep.dh 29
        $.ajax({
30
            type    : "PUT",
31
            url     : "/inventory/doa-out/" + $(this).attr('inventoryItemId'),
32
            data    : $(this).serialize(),
33
            success : function(response) {
34
                document.location.href = "/inventory/doa-out";
35
            }
36
        });
37
 
38
        return false;
39
    });
40
 
14491 manish.sha 41
    $('.orderIdInfo').on('click', function(){
10886 manish.sha 42
		inventoryItemId = $(this).attr('id');
43
		$.ajax({
44
	        type : "GET",
45
	        url : "/inventory/doa-in!getOrderIdDOAInItem?id="+inventoryItemId,
46
	        success : function(response) {
47
	        	$.colorbox({
48
					inline : true,
49
			        width : "350px",
50
			        height : "150px",
51
			        opacity : "0.20",
52
			        overlayClose :	true,
53
			        escKey :	true,
54
			        href : $(response),
55
			        onClosed : function() {
56
 
57
			        }
58
				});
59
	        },
60
	        error : function(response) {
61
				alert("Error in fetching Order Id");
62
			}			
63
	    });
64
	});
65
 
10490 amar.kumar 66
    /*$('.doa-close-credit-note').hide();
10489 amar.kumar 67
 
68
    $('.closeDOAButton').live('click', function() {
69
        $(this).hide();
70
        $(this).siblings('.doa-close-credit-note').show();
10490 amar.kumar 71
    });*/
10489 amar.kumar 72
 
5185 mandeep.dh 73
});
14491 manish.sha 74
 
75
 
76
/*var grid = $("#grid-command-buttons").bootgrid({
77
    ajax: true,
78
    post: function ()
79
    {
80
        return {
81
            id: "b0df282a-0d67-40e5-8558-c9e93b7befed"
82
        };
83
    },
84
    url: "/api/data/basic",
85
    formatters: {
86
        "commands": function(column, row)
87
        {
88
            return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " + 
89
                "<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-trash-o\"></span></button>";
90
        }
91
    }
92
}).on("loaded.rs.jquery.bootgrid", function()
93
{
94
     Executes after data is loaded and rendered 
95
    grid.find(".command-edit").on("click", function(e)
96
    {
97
        alert("You pressed edit on row: " + $(this).data("row-id"));
98
    }).end().find(".command-delete").on("click", function(e)
99
    {
100
        alert("You pressed delete on row: " + $(this).data("row-id"));
101
    });
102
});*/