Subversion Repositories SmartDukaan

Rev

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