generate a custom dilog before deleting a row ? tricky one
generate a custom dilog before deleting a row ? tricky one
sunildon
Posts: 40Questions: 7Answers: 0
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
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
This discussion has been closed.
Replies
Allan
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