how can I pass multiple parameter to the function

how can I pass multiple parameter to the function

polachanpolachan Posts: 101Questions: 50Answers: 0

Hi
I have given my code given below. I want to pass ID,EmployeeName,ClockedDatetoListas argument to the function from the clicked event of button . ShowDeleteModalPopup. Please can you help me with suggested code

  var table=  $('#tblData').DataTable({
                "ajax": {
                    "url": "/Home/GetClockList?employeeid=" + $('#dropdownEmployee').val()
                    + "&clockdate=" + $('#txtAttendanceDate').val() ,
                    "type": "GET",
                    "datatype": "json",
                    "dataSrc": function (json) {
                        return JSON.parse(json);
                    }
                 },
                "columns": [
                    { "data": 'ID', "width": "6%" },
                    { "data": 'EmployeeName', "width": "20%" },
                    { "data": 'ClockedDatetoList', "width": "20%" },
                    {
                        "data": "ID",
                        "render": function (data) {
                            return `<div class="text-center">
                            <a class='btn btn-danger text-white' style='cursor:pointer; width:100px;' onclick="ShowDeleteModalPopup(${data})" >
                               <i class='far fa-trash-alt'></i> Delete
                            </a></div>
                        `;
                        }, "width": "5%"
                    }

                ],

function ShowDeleteModalPopup()
            alert(id);
            $('#lblID').val(id);
            $('#deleteConfirmationModal').modal('show');
        }

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

This discussion has been closed.