Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21627 kshitij.so 1
$(document).ready(function() {
2
 
3
        // begin first table
4
        $('#sample_1').dataTable({
5
            "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
6
            "sPaginationType": "bootstrap",
7
            "oLanguage": {
8
                "sLengthMenu": "_MENU_ records per page",
9
                "oPaginate": {
10
                    "sPrevious": "Prev",
11
                    "sNext": "Next"
12
                }
13
            },
14
            "aoColumnDefs": [{
15
                'bSortable': false,
16
                'aTargets': [0]
17
            }]
18
        });
19
 
20
        jQuery('#sample_1 .group-checkable').change(function () {
21
            var set = jQuery(this).attr("data-set");
22
            var checked = jQuery(this).is(":checked");
23
            jQuery(set).each(function () {
24
                if (checked) {
25
                    $(this).attr("checked", true);
26
                } else {
27
                    $(this).attr("checked", false);
28
                }
29
            });
30
            jQuery.uniform.update(set);
31
        });
32
 
33
        jQuery('#sample_1_wrapper .dataTables_filter input').addClass("form-control"); // modify table search input
34
        jQuery('#sample_1_wrapper .dataTables_length select').addClass("form-control"); // modify table per page dropdown
35
 
36
        // begin second table
37
        $('#sample_2').dataTable({
38
            "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
39
            "sPaginationType": "bootstrap",
40
            "oLanguage": {
41
                "sLengthMenu": "_MENU_ per page",
42
                "oPaginate": {
43
                    "sPrevious": "Prev",
44
                    "sNext": "Next"
45
                }
46
            },
47
            "aoColumnDefs": [{
48
                'bSortable': false,
49
                'aTargets': [0]
50
            }]
51
        });
52
 
53
        jQuery('#sample_2 .group-checkable').change(function () {
54
            var set = jQuery(this).attr("data-set");
55
            var checked = jQuery(this).is(":checked");
56
            jQuery(set).each(function () {
57
                if (checked) {
58
                    $(this).attr("checked", true);
59
                } else {
60
                    $(this).attr("checked", false);
61
                }
62
            });
63
            jQuery.uniform.update(set);
64
        });
65
 
66
        jQuery('#sample_2_wrapper .dataTables_filter input').addClass("form-control"); // modify table search input
67
        jQuery('#sample_2_wrapper .dataTables_length select').addClass("form-control"); // modify table per page dropdown
68
 
69
        // begin: third table
70
        $('#sample_3').dataTable({
71
            "sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
72
            "sPaginationType": "bootstrap",
73
            "oLanguage": {
74
                "sLengthMenu": "_MENU_ per page",
75
                "oPaginate": {
76
                    "sPrevious": "Prev",
77
                    "sNext": "Next"
78
                }
79
            },
80
            "aoColumnDefs": [{
81
                'bSortable': false,
82
                'aTargets': [0]
83
            }]
84
        });
85
 
86
        jQuery('#sample_3 .group-checkable').change(function () {
87
            var set = jQuery(this).attr("data-set");
88
            var checked = jQuery(this).is(":checked");
89
            jQuery(set).each(function () {
90
                if (checked) {
91
                    $(this).attr("checked", true);
92
                } else {
93
                    $(this).attr("checked", false);
94
                }
95
            });
96
            jQuery.uniform.update(set);
97
        });
98
 
99
        jQuery('#sample_3_wrapper .dataTables_filter input').addClass("form-control"); // modify table search input
100
        jQuery('#sample_3_wrapper .dataTables_length select').addClass("form-control"); // modify table per page dropdown
101
 
102
 
103
 
104
});