Subversion Repositories SmartDukaan

Rev

Rev 29813 | Rev 33045 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(function() {

        $(document).on('click', ".partner-credit-detail", function() {

                loadCreditDetail("main-content");
        });




        $(document).on('click', '.activate-partner-kred', function() {
                var row = $(this).closest("tr");
                var id = $(this).data('id');
                console.log(id)
                if (confirm('Are you sure you want to activate?')) {
                        doPostAjaxRequestHandler(context + "/activateKred?id=" + id,
                                function(response) {
                                        row.html(response);
                                        alert("successfully activate");



                                });
                }
        });

        $(document).on('click', '.deactivate-partner-kred', function() {
                var row = $(this).closest("tr");
                var id = $(this).data('id');
                console.log(id)

                if (confirm('Are you sure you want to deactivate?')) {
                        doPostAjaxRequestHandler(context + "/deactivateKred?id=" + id,
                                function(response) {
                                        row.html(response);
                                        alert("successfully deactivate");

                                });
                }
        });

});

function loadCreditDetail(domId) {
        doGetAjaxRequestHandler(context + "/getCreditDetail",
                function(response) {
                        $('#' + domId).html(response);
                });


}