Using SP out of box Edit icon with Data Tables
Posted: 23 May 2018
Hello,
I am able to use Data tables within my SP forms which is a great enhancement to my forms. But is there a way to bring in the SharePoint out of box "Edit" icon on the data tables view?
Here is the js code.
<script>
$(document).ready(function() {
$('#requests').DataTable({
'ajax': {
'url': "myurl/items?$select=Title,City,Classification,PositionTitle,TA%5Fx002d%5FID2,Update,Edit/Id,Edit/Title&expand=Edit&$filter=(Classification eq 'Pooled')&$top=1000",
'headers': { 'Accept': 'application/json;odata=nometadata' },
'dataSrc': function(data) {
return data.value.map(function(item) {
return [
item.Title,
item.City,
item.Classification,
item.TA_x002d_ID2,
item.PositionTitle,
item.Update,
item.Edit
];
});
}
}
});
});
</script>
Thank you for your help.
Joe
I am able to use Data tables within my SP forms which is a great enhancement to my forms. But is there a way to bring in the SharePoint out of box "Edit" icon on the data tables view?
Here is the js code.
<script>
$(document).ready(function() {
$('#requests').DataTable({
'ajax': {
'url': "myurl/items?$select=Title,City,Classification,PositionTitle,TA%5Fx002d%5FID2,Update,Edit/Id,Edit/Title&expand=Edit&$filter=(Classification eq 'Pooled')&$top=1000",
'headers': { 'Accept': 'application/json;odata=nometadata' },
'dataSrc': function(data) {
return data.value.map(function(item) {
return [
item.Title,
item.City,
item.Classification,
item.TA_x002d_ID2,
item.PositionTitle,
item.Update,
item.Edit
];
});
}
}
});
});
</script>
Thank you for your help.
Joe