Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
30973 amit.gupta 1
<div class="col-lg-12">
2
    <table class="table table-border table-condensed table-bordered" id="commitment-table" style="width:100%">
30185 tejbeer 3
 
30973 amit.gupta 4
        <thead class="row htable" style="background:#F5F5F5;">
30185 tejbeer 5
 
30973 amit.gupta 6
        <tr style="color:black;">
7
            <th rowspan="2">Committed By</th>
8
            <th rowspan="2">Partner Name</th>
9
            <th colspan="2">Collection</th>
10
            <th colspan="2">Total</th>
11
            <th colspan="2">Samsung</th>
12
            <th colspan="2">Oppo</th>
13
            <th colspan="2">Vivo</th>
14
            <th colspan="2">Itel</th>
15
            <th colspan="2">Almost New</th>
16
            <th colspan="2">Others</th>
17
        </tr>
18
        <tr>
19
            <th>Target(<span id="coltgt"> </span>)</th>
20
            <th>Ach (<span id="colach"> </span>)</th>
21
            <th>Tgt</th>
22
            <th>Ach</th>
23
            <th>Tgt</th>
24
            <th>Ach</th>
25
            <th>Tgt</th>
26
            <th>Ach</th>
27
            <th>Tgt</th>
28
            <th>Ach</th>
29
            <th>Tgt</th>
30
            <th>Ach</th>
31
            <th>Tgt</th>
32
            <th>Ach</th>
33
            <th>Tgt</th>
34
            <th>Ach</th>
35
        </tr>
36
        </thead>
37
        <tbody>
38
            #foreach($commitment in $commitments )
39
 
40
            <tr>
41
                #parse("team-commitment-index.vm")
42
 
30185 tejbeer 43
            </tr>
44
 
30973 amit.gupta 45
            #end
30185 tejbeer 46
 
30973 amit.gupta 47
        </tbody>
30185 tejbeer 48
 
30973 amit.gupta 49
    </table>
50
</div>
30185 tejbeer 51
 
30973 amit.gupta 52
<script type="text/javascript">
53
    $(document).ready(function () {
54
        var table = $('#commitment-table').DataTable({
55
            "scrollX": true,
56
            "bPaginate": true,
57
            "bLengthChange": true,
58
            "bFilter": true,
59
            "bInfo": false,
60
            "bAutoWidth": false,
61
            "pageLength": 100,
62
 
63
 
64
        });
65
 
66
        datatableSum();
67
        table.on('search.dt', function () {
30185 tejbeer 68
            console.log('Currently applied global search: ' + table.search());
69
            datatableSum();
70
 
30973 amit.gupta 71
 
30185 tejbeer 72
        });
30973 amit.gupta 73
    });
30185 tejbeer 74
 
30973 amit.gupta 75
 
76
    function datatableSum() {
77
 
78
        var col_tgt_sum = $('#commitment-table').DataTable().column(2, {page: 'current'}).data().sum();
79
        $('#coltgt').html(col_tgt_sum);
80
 
81
 
82
        var col_acv_sum = $('#commitment-table').DataTable().column(3, {page: 'current'}).data().sum();
83
        console.log(col_acv_sum)
84
        $('#colach').html(col_acv_sum);
85
 
86
    }
87
 
88
 
30185 tejbeer 89
</script>