Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82603

ColumnDefs not workin

$
0
0

Can anyone tell me why the custom column won't appear? The date pulled from the api is rendering but the additional column isn't.

<script>
  $(document).ready(function () {
    $("#data").DataTable({
      ajax: "/api/data",
      columns: [
        { data: "name" },
        { data: "age", searchable: false },
        { data: "address", orderable: false, searchable: false },
        { data: "phone", orderable: false, searchable: false },
        { data: "email" },
      ],
      columnDefs: [
        {
          targets: -1,
          data: null,
          defaultContent: "<button>Click!</button>",
        },
      ],
    });
  });
</script>

Viewing all articles
Browse latest Browse all 82603

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>