Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
33045 amit.gupta 1
$(function () {
29811 tejbeer 2
 
33045 amit.gupta 3
    $(document).on('click', ".partner-credit-detail", function () {
29811 tejbeer 4
 
33045 amit.gupta 5
        loadCreditDetail("main-content");
6
    });
29811 tejbeer 7
 
8
 
33045 amit.gupta 9
    $(document).on('click', '.activate-partner-kred', function () {
10
        var row = $(this).closest("tr");
11
        var id = $(this).data('id');
12
        let gateway = $(row).find('select').val();
13
        console.log(id)
14
        if (confirm(`Are you sure you want to activate ${gateway}?`)) {
15
            doPostAjaxRequestHandler(`${context}/activateKred?id=${id}&gateway=${gateway}`,
16
                function (response) {
17
                    row.html(response);
18
                    alert(`${gateway} successfully activated`);
29811 tejbeer 19
 
20
 
33045 amit.gupta 21
                });
22
        }
23
    });
29811 tejbeer 24
 
33045 amit.gupta 25
    $(document).on('click', '.deactivate-partner-kred', function () {
26
        var row = $(this).closest("tr");
27
        var id = $(this).data('id');
28
        console.log(id)
29811 tejbeer 29
 
33045 amit.gupta 30
        if (confirm('Are you sure you want to deactivate?')) {
31
            doPostAjaxRequestHandler(context + "/deactivateKred?id=" + id,
32
                function (response) {
33
                    row.html(response);
34
                    alert(`${gateway} successfully deactivated`);
35
                });
36
        }
37
    });
30877 tejbeer 38
 
29811 tejbeer 39
});
40
 
41
function loadCreditDetail(domId) {
33045 amit.gupta 42
    doGetAjaxRequestHandler(context + "/getCreditDetail",
43
        function (response) {
44
            $('#' + domId).html(response);
45
        });
29811 tejbeer 46
 
30877 tejbeer 47
 
29811 tejbeer 48
}