Subversion Repositories SmartDukaan

Rev

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

Rev 32137 Rev 32158
Line 10... Line 10...
10
    </div>
10
    </div>
11
 
11
 
12
    <form id="warehouse-stock" class="row form-inline" onsubmit="sumbmitHandler(event)">
12
    <form id="warehouse-stock" class="row form-inline" onsubmit="sumbmitHandler(event)">
13
        <div class="col-lg-4 form-group">
13
        <div class="col-lg-4 form-group">
14
            <label>Select Brand</label>
14
            <label>Select Brand</label>
15
            <select class="form-control">
15
            <select class="form-control" id="brands" multiple>
16
                #foreach($brand in $brands)
16
                #foreach($brand in $brands)
17
                    <option value="$brand">$brand</option>
17
                    <option value="$brand">$brand</option>
18
                #end
18
                #end
19
            </select>
19
            </select>
20
        </div>
20
        </div>
Line 30... Line 30...
30
</section>
30
</section>
31
<script type="text/javascript">
31
<script type="text/javascript">
32
 
32
 
33
    function sumbmitHandler(event) {
33
    function sumbmitHandler(event) {
34
        event.preventDefault();
34
        event.preventDefault();
35
        let brand = $(event.target).find('select').val();
35
        let brands1 = $("#brands").val().join(",");
-
 
36
        console.log(brands1);
36
        doGetAjaxRequestHandler(`${context}/warehouse/stock-qty/${brand}`, function (data) {
37
        doGetAjaxRequestHandler(`${context}/warehouse/stock-qty/by?brands=${brands1}`, function (data) {
37
            $('.brandwise-stock-container').html(data);
38
            $('.brandwise-stock-container').html(data);
38
        })
39
        })
39
    }
40
    }
40
 
41
 
-
 
42
    $('#brands').multiselect({
-
 
43
        includeSelectAllOption: true,
-
 
44
        maxHeight: 200,
-
 
45
        multiple: true,
-
 
46
        buttonWidth: '180px',
-
 
47
        numberDisplayed: 1,
-
 
48
        nonSelectedText: 'Brands',
-
 
49
        nSelectedText: ' - Brands Selected',
-
 
50
        allSelectedText: 'All Brand Selected',
-
 
51
        enableFiltering: true,
-
 
52
        enableCaseInsensitiveFiltering: true
-
 
53
    });
-
 
54
 
41
 
55
 
42
</script>
56
</script>
43
 
57