Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

Columns.Render - Accessing data for more than 1 column in the render function

$
0
0

Hi all,

I am using datatables with server side rendering and my render function is as follows for a column in my table :

             {
                    "data": "Errors",
                    "width": "5%",
                    "orderable": false,
                    "render":
                        function (data, type, row) {
                            var myUrl = '@Url.Action("Foo", "Bar")/' + data;
                            return '<a href=\"' + myUrl + '\">'+data+'</a>';

                        }
                }

What I need to do is display the value for the data (which is the errors colum) in my link but pass the value of another column (id) as the parameter when the url is clicked. So for the line var myUrl = '@Url.Action("Foo", "Bar")/' + data; I would like to pass the value of the 'Id' column as data. Is there any way to do this ?

Thanks


Viewing all articles
Browse latest Browse all 2364

Trending Articles