How to add link to Title field when list data is fetched using REST API and rendered through Datatab

How to add link to Title field when list data is fetched using REST API and rendered through Datatab

facesagarfacesagar Posts: 1Questions: 0Answers: 0
edited April 2014 in General
Datatable and SharePoint REST API are wonderful tools to satisfy my client's hunger. I need a small help on one point though.




Title
Id








var call = $.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('listname')/items?$select=Title,Id,
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data,textStatus, jqXHR){
$('#example').dataTable({
"sDom": '<"H"Cfr>t<"F"ip>',
"bJQueryUI": true,
"bDestroy" : true,
"bProcessing": true,
"aaData": data.d.results,
"aoColumns": [
{ "mData": "Title",
"mData": "Id" }
]
});
});
Using above SharePoint REST API Code I am able to get all list items "Title" & "id" field in the datatable, however what I am looking for is how to add links to "Title" field which will take URL to DispForm.aspx?Id=?? page. Basically, trying to create a custom view which will have link to Title field and few other columns displayed in the datatable. I have just started using SharePoint REST API and datatable.js so not sure if it can be achieved. If someone knows or have a different idea please share. Thanks!
This discussion has been closed.