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

Accessing Data table details in separate file

$
0
0

Hope you can help with this i am new data table's.

We have a data-table that is set up in partial view

             <table id="Qualities" class="table table-striped table-bordered table-td-valign-middle" data-detailLink='@Url.Action("Detail", new { id = "__id__" })' onclick="DetailView(this);">

            var table = $('#Qualities').DataTable({
                        responsive: true,
                        retrieve: true,
                        "scrollY": "400px",
                        "scrollCollapse": true,
                        "paging": true,

                        "ajax": {
                            "url": 
                            "dataSrc": "data"
                        },

                        rowId:"ID"
                    });

in a separate file i have a function that loads a detail based on the selected row's id and the detail link. I can get the datatable but struggling to find a way of getting the id.

i have tried converting the passed in variable to

function DetailView(e) {
    debugger;


    var table = e.dataTable();

    var detailLink = e.dataset.detaillink;

but i am getting the error

Uncaught TypeError: e.dataTable is not a function

If someone could point me in the right direction as i am sure it can be done but if not saves me chasing my tail.


Viewing all articles
Browse latest Browse all 81728

Trending Articles



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