Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Add link with column with dataTable in html table

$
0
0

Hi guys,

i have a table that show a Sharepoint list in a Html table via dataTable.This work fine but i need that the title column of the table is a clickable link  to the display form.. any idea?

this is my code

function GetCalendar()
{
var call = $.ajax({
url:  "https://sarix2014.sharepoint.com/Demo%20Intranet/_api/web/lists/getbytitle('Calendar')/Items?$select=Title,EventDate,ID,EndDate,Location,Description",
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": "ID" },
{ "mData": "Title" },
{ "mData": "Description"},
{ "mData": "Location"},
{ "mData": "EventDate"},

{ "mData": "EndDate" }

]
});
});

call.fail(function (jqXHR,textStatus,errorThrown){
alert("Error retrieving Calendar event: " + jqXHR.responseText);
});

}

</script>


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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