Hyper link in Datatable column
Hyper link in Datatable column
amar.0925@gmail.com
Posts: 2Questions: 1Answers: 0
I want to display hyper link in datatable column, here is my code.
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('ZipCodes')/items?"+
"$select=Title,City,State,Link&$filter=(State eq '"+state+"')&$top=5000",
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data,textStatus, jqXHR){
$('#example').dataTable({
"bDestroy": true,
"bProcessing": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "Title" },
{ "mData": "City" },
{ "mData": "State" },
{ "mData": "<<Hyper link>>" }
]
});
});
This discussion has been closed.
Answers
You can use
columns.render
to create the link with the option of passing the data as a parameter.it is not working , here is my complete Script .
<link rel="stylesheet" type="text/css"
href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css">
State: <input type="text" id="State" >
<input type="button" value="Get Zip Codes" onclick="LoadZipCodes($('#State').val());" >