Subversion Repositories SmartDukaan

Rev

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

Rev 10886 Rev 14491
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
    $('table#doa-items').dataTable({
2
    $('table#doa-items').dataTable({
3
        "aaSorting" : [ [ 1, 'desc' ] ],
-
 
4
        "iDisplayLength" : 20,
-
 
5
        "sDom": 'T<"clear">lfrtip',
-
 
6
        "aLengthMenu" : [ [ 20, 50, 100, -1 ], [ 20, 50, 100, "All" ] ]
3
    	"lengthMenu": [[20, 50, 100, -1], [20, 50, 100, "All"]]
7
    });
4
    });
8
    
5
    
9
    $('#doa-in').live('submit', function() {
6
    $('#doa-in').on('submit', function() {
10
        $.ajax({
7
        $.ajax({
11
            type    : "PUT",
8
            type    : "PUT",
12
            url     : "/inventory/doa-in/" + $(this).attr('inventoryItemId'),
9
            url     : "/inventory/doa-in/" + $(this).attr('inventoryItemId'),
13
            data    : $(this).serialize(),
10
            data    : $(this).serialize(),
14
            success : function(response) {
11
            success : function(response) {
Line 17... Line 14...
17
        });
14
        });
18
        
15
        
19
        return false;
16
        return false;
20
    });
17
    });
21
    
18
    
22
    $('#doa-out').live('submit', function() {
19
    $('#doa-out').on('submit', function() {
23
        $.ajax({
20
        $.ajax({
24
            type    : "PUT",
21
            type    : "PUT",
25
            url     : "/inventory/doa-out/" + $(this).attr('inventoryItemId'),
22
            url     : "/inventory/doa-out/" + $(this).attr('inventoryItemId'),
26
            data    : $(this).serialize(),
23
            data    : $(this).serialize(),
27
            success : function(response) {
24
            success : function(response) {
Line 30... Line 27...
30
        });
27
        });
31
 
28
 
32
        return false;
29
        return false;
33
    });
30
    });
34
    
31
    
35
    $('.orderIdInfo').live('click', function(){
32
    $('.orderIdInfo').on('click', function(){
36
		inventoryItemId = $(this).attr('id');
33
		inventoryItemId = $(this).attr('id');
37
		$.ajax({
34
		$.ajax({
38
	        type : "GET",
35
	        type : "GET",
39
	        url : "/inventory/doa-in!getOrderIdDOAInItem?id="+inventoryItemId,
36
	        url : "/inventory/doa-in!getOrderIdDOAInItem?id="+inventoryItemId,
40
	        success : function(response) {
37
	        success : function(response) {
Line 63... Line 60...
63
        $(this).hide();
60
        $(this).hide();
64
        $(this).siblings('.doa-close-credit-note').show();
61
        $(this).siblings('.doa-close-credit-note').show();
65
    });*/
62
    });*/
66
    
63
    
67
});
64
});
-
 
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
});*/