Nice use of the CSR Venkat - I learned something.
The old fashioned way - you can use a REST call to get the list of fields for the list.
/SITENAME/_api/web/lists/getbytitle('LIST NAME')/Fields
Then loop through the d.results
- there are attributes for the Description
, and for each field with a description you could use the Title
to match up with the display name of the field on the page, and append the information to the row .
An example:
<script type="text/javascript" src="/Javascript/JQuery/JQueryMin-1.11.1.js"></script>
<script type="text/javascript">
$(document).ready(function() {
displayDescriptions();
});
function displayDescriptions() {
var options = "";
$.ajax({
url: _spPageContextInfo.webServerRelativeUrl +
"/_api/web/lists/getbytitle('LIST_TITLE_HERE')/Fields" ,
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
},
success: function (data) {
$.each(data.d.results, function(index, value) {
if(value.Description != '') {
$('h3:contains("' + value.Title + '")').eq(0).parents('tr:first').find('td').eq(1).prepend('<b>' + value.Description + '</b><br />');
}
});
},
error: function (err) {
alert('Error in retrieving descriptions: ' + JSON.stringify(err));
}
});
}
</script>