Subversion Repositories SmartDukaan

Rev

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