generate a custom dilog before deleting a row ? tricky one

generate a custom dilog before deleting a row ? tricky one

sunildonsunildon Posts: 40Questions: 7Answers: 0
edited April 2014 in DataTables
Hi

I am working on this awesome datatable . If i select a row and press my delete button i need some additional functionality done here .

I need to get a popup asking for reason of deletion and when i press OK the controller should get HIT with ID to get deleted and reason as string .

i Will make my controller action method for deletion as parameterised .

[code]
My code :

$(document).ready(function () {

$('#DropDown_Select').change(function () {
oTable.fnFilter($(this).val());
});
var oTable= $('#myDataTable').dataTable({

"bProcessing": true,
"bServerSide": true,
"bFilter": true,
"bAutoWidth": true,
"sAjaxSource": "AjaxHandler" ,
"fnServerData": function (sSource, aoData, fnCallback) {
sSource = sSource + "/" + $('#DropDown_Select').val();
$.getJSON(sSource, aoData, function (json)
{
fnCallback(json)
});
},

"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "sName": "Lead_Id"},
{ "sName": "LeadName" },
{ "sName": "ContactName"},
{ "sName": "CompanyName" },
]

});

oTable.makeEditable({

sDeleteURL: "/Home/DeleteData" //when i click delete based on this path the control goes to controller . Before deletioin i have to get a popup with asking reason ?

});


});
[/code]
Regards Any help is gold dust at this moment

Replies

  • allanallan Posts: 61,672Questions: 1Answers: 10,098 Site admin
    makeEditable is third party software and not supported here. You could ask in that software's own issue list, although as far as I am aware it is deprecated now.

    Allan
  • sunildonsunildon Posts: 40Questions: 7Answers: 0
    edited April 2014
    Oh darn . is there any alternative to it so i can carry with my present functioanlity

    I need a textbox prompt to write a reason(using prompt) why we are deleting on click on delete button and later on If u press OK in my popup it should reach my controller code with ROW_ID & string Reason .

    Please please just help me to find some workaround .

    My controller look like this :
    [code]
    public ActionResult DeleteData(int id,string reason)
    {
    return view();
    }
    [/code]

    Regards
This discussion has been closed.