Basically your code is okay, thats the right way to do this. Anyhow, there are some misunderstandings:

  1. fetchUserData.cfm does not contain key/value pairs. So it doesn't make sense to address keys in mData. Just use mData[index]

  2. dataTables expects some more info from your serverside. At least you should tell datatables how many items in total are on your serverside and how many are filtered. I just hardcoded this info to your data. You should get the right values from counts in your server sided script.

    {
     "iTotalRecords":"6",
     "iTotalDisplayRecords":"6",
      "aaData": [
    [
        "1",
        "sameek",
        "sam",
        "sam",
        "[email protected]",
        "1",
        ""
    ],...
    
  3. If you have the column names already set in the html part, you don't need to add sTitle.

  4. The mRender Function takes three parameters:

    • data = The data for this cell, as defined in mData
    • type = The datatype (can be ignored mostly)
    • full = The full data array for this row.

So your mRender function should look like this:

  "mRender": function(data, type, full) {
    return '<a class="btn btn-info btn-sm" href=#/' + full[0] + '>' + 'Edit' + '</a>';
  }

Find a working Plunker here

Answer from mainguy on Stack Overflow
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 3.2.6
Buttons 3.2.6
//cdn.datatables.net/buttons/3.2.6/css/buttons.bootstrap.css
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 2.3.5
Buttons 2.3.5
Only one minor functional change in this release, but it also continues the work of making DataTables Typescript definitions more complete by allowing other extensions to extend the button configuration objects.
🌐
Vuetify
vuetifyjs.com β€Ί en β€Ί components β€Ί cards
Card component β€” Vuetify
The v-card component is a versatile and enhanced sheet of paper that provides a simple interface for headings, text,...
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 1.1.0
Buttons 1.1.0
This release of Buttons addresses a number of issues, primarily around the export of files (correct CSV escaping, certain data casing invalid Excel files to be created, and others). It also introduces a few new features such as automatic copy to clipboard for HTML5 and a new pageLength button type that can be used to replace the DataTables default page length menu (since Buttons often takes the place of the length menu).
🌐
MUI
mui.com β€Ί material-ui β€Ί react-pagination
React Pagination component - Material UI
You can optionally enable first-page and last-page buttons, or disable the previous-page and next-page buttons.
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 1.2.0
Buttons 1.2.0
The way Buttons addresses created buttons has been completely rewritten to address a couple of issues and memory issues that arose from use of dynamic buttons.
Find elsewhere
🌐
DataTables
datatables.net β€Ί forums β€Ί discussion β€Ί 79726 β€Ί copy-print-buttons-with-datatables-editor
Copy, Print buttons with datatables editor β€” DataTables forums
libs: {"targetFramework":"","js":["jquery","datatables","buttons","select","datetime","editor"],"css":["datatables","buttons","select","datetime","editor"],"components":{"datatables":{"css":"https:\/\/cdn.datatables.net\/2.0.2\/css","js":"https:\/\/cdn.datatables.net\/2.0.2\/js","resolve":true},"autofill":{"css":"https:\/\/cdn.datatables.net\/autofill\/2.7.0\/css","js":"https:\/\/cdn.datatables.net\/autofill\/2.7.0\/js","resolve":true},"buttons":{"css":"https:\/\/cdn.datatables.net\/buttons\/3.0.1\/css","js":"https:\/\/cdn.datatables.net\/buttons\/3.0.1\/js","resolve":true},"colreorder":{"css"
🌐
DataTables
datatables.net β€Ί reference β€Ί event β€Ί buttons-action
buttons-action
var table = new DataTable('#myTable'); table.on('buttons-action', function (e, buttonApi, dataTable, node, config) { console.log('Button ' + buttonApi.text() + ' was activated'); });
🌐
Untitled UI
untitledui.com β€Ί react
Untitled UI React β€” React UI Component Library
Untitled UI React base components are 100% free and open source. These include foundational UI components such as buttons, inputs, text editors, tooltips, and other useful building blocks for modern interfaces and websites.
🌐
DataTables
datatables.net β€Ί forums β€Ί discussion β€Ί 66130 β€Ί how-do-i-add-custom-buttons-and-crud-buttons-to-editor-custom-form
How do I add custom buttons (and crud buttons) to editor custom form β€” DataTables forums
DataTables' Editor provides all of that functionality. https://editor.datatables.net/examples/simple/simple.html ... This discussion has been closed. ... It looks like you're new here. If you want to get involved, click one of these buttons!
🌐
DataTables
datatables.net β€Ί reference β€Ί api β€Ί buttons().containers()
buttons().containers()
Comprehensive editing library for DataTables. ... Get the container elements for one or more button instances.
🌐
Angular powered Bootstrap
ng-bootstrap.github.io
Angular powered Bootstrap
Bootstrap widgets for Angular: autocomplete, accordion, alert, carousel, datepicker, dropdown, offcanvas, pagination, popover, progressbar, rating, scrollspy, tabset, timepicker, tooltip, typeahead
🌐
DataTables
datatables.net β€Ί forums β€Ί discussion β€Ί 69545 β€Ί buttons-to-datatable-not-working
Buttons to datatable not working β€” DataTables forums
August 25, 2021 - $('#datatable1').DataTable({ responsive: true, "order": [], dom: 'Bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ], language: { searchPlaceholder: 'Search...', sSearch: '', lengthMenu: '_MENU_ items/page', } });
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 1.4.1
Buttons 1.4.1
//cdn.datatables.net/buttons/1.4.1/css/buttons.bootstrap.css
🌐
Bootstrap
getbootstrap.com β€Ί docs β€Ί 5.3 β€Ί content β€Ί tables
Tables Β· Bootstrap v5.3
Documentation and examples for opt-in styling of tables (given their prevalent use in JavaScript plugins) with Bootstrap.
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 3.1.0
Buttons 3.1.0
The main aspect of this release is a rewrite of how the Typescript types for prebuilt buttons work.
🌐
DataTables
datatables.net β€Ί forums β€Ί discussion β€Ί 66457 β€Ί datatable-buttons-display
Datatable buttons display β€” DataTables forums
You can use dom to place things around the table. You can also have fine tuning of the placement of Buttons by using the constructor as shown in this example,
🌐
Datatables
cdn.datatables.net β€Ί buttons β€Ί 1.6.0
Buttons 1.6.0
Fix: Added class flex-wrap to button container for Bootstrap 4 to allow button wrapping. //cdn.datatables.net/buttons/1.6.0/swf/flashExport.swf