Hi
How the below 2 lines works. Secondly how to call function on click of Edit
{
"render": function (data, type, full, meta)
},
{
data: null, render: function (data, type, row) {
}
},
- $(document).ready(function () {
- //loadData();
- $("#tblLocation").dataTable({
- ajax: {
- type: "get",
- url: "/Location/List",
- dataType: "json",
- dataSrc: ""
- },
- paging: true,
- sort: true,
- pageLength: 10,
- searching: true,
- columns: [
- { 'data': 'Id', "autoWidth": true },
- { 'data': 'Description', "autoWidth": true },
- { 'data': 'IsActive', "autoWidth": true },
- {
- "render": function (data, type, full, meta)
- { return ' + full.Id + '">'; }
- },
- {
- data: null, render: function (data, type, row) {
- return " + row.Id + "'); >";
- }
- },
- ]
- });
- $('body').on('click', '[id*=btnEdit]', function () {
- var data = $(this).parents('tr').find('td');
- var id = data.eq(0).html();
- var description = data.eq(1).html();
- $('[id*=txtId]').val(id);
- $('[id*=txtDescription]').val(description);
- $("#btnAdd").hide();
- $(".modal-title").html("Update");
- $("#btnUpdate").show();
- $('#myModal').modal("show");
- });
- });
Thanks

Sachin SinghRank #66 · 26.2K reputationPosted May 31, 2021, 4:55 AM EDT
Asma KhalidRank #160 · 14.7K reputationPosted May 31, 2021, 4:51 AM EDT