Add Edit link to each row and open up a partial view with that link (MVC)

Add Edit link to each row and open up a partial view with that link (MVC)

triventriven Posts: 1Questions: 0Answers: 0
edited March 2014 in DataTables 1.10
Hi there,

I am using the datatable with bootstrap and populating the values via ajax call, currently I have 2 columns I want to add edit and delete functionality to each row data (as it gets populate via ajax call) and on edit or on delete it should call a partial view.Below are the code snippets,Please help !!


[code]



Name
Properties





$(document).ready(function () {
processorContent();

});
function loadContent() {
$('#tblloadcontent').dataTable({
"sAjaxSource": "/Admin/Admin/AjaxHandler",
"bProcessing": true,
"aoColumns": [
{ "sName": "Name" },
{ "sName": "Properties" },
]
});
}
[/code]
Thanks

Replies

  • allanallan Posts: 61,722Questions: 1Answers: 10,108 Site admin
    edited March 2014
    This example shows how you could add an inline edit and delete link: https://editor.datatables.net/release/DataTables/extras/Editor/examples/inlineControls.html . The example uses Editor, but the sDefaultContent part is the part I'm trying to highlight here. You can use that with any editing environment. It just creates a link...

    Allan
  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394
    Allan - that doesn't look like the right link.
  • allanallan Posts: 61,722Questions: 1Answers: 10,108 Site admin
    Certainly wasn't! Thanks for spotting that. Fixed now.

    Allan
This discussion has been closed.