DataTables .makeEditable: confirmation alert before adding new row
DataTables .makeEditable: confirmation alert before adding new row
I have the following code, sAddNewRowOkButtonId: "btnAddNewRowOk".. When I click a create button a modal form appears. An add button is added to this form called "btnAddNewRowOk", how do I add confirmation button?
I placed the js code below in the "btnAddNewRowOk" click event and under "fnStartProcessingMode: function () {", regardless if I click cancel..it process and adds row :
[code]
if( !confirm('Are you sure that you want to submit the form')) {
return false;
}
[/code]
Is there a place I can add javascript to prevent adding a row when cancelled is clicked?
[code]
$('#cfo').dataTable( {
"sScrollY": "400px",
"bScrollCollapse": true,
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/Diplom/cfo",
"aoColumns": [
{ "sName": "ID",
"bSearchable": false,
"bSortable": false,
"bVisible": false
},
{ "sName": "KOD",
"sWidth": "10%"},
{ "sName": "NAME",
"sWidth": "90%"}
]
}).makeEditable({
"aoColumns": [
{ width: "80%" },
{ width: "80%" }
],
sAddNewRowFormId: "formAddNewRow",
sAddNewRowButtonId: "btnAddNewRow",
sAddNewRowOkButtonId: "btnAddNewRowOk",
sAddNewRowCancelButtonId: "btnAddNewRowCancel",
sDeleteRowButtonId: "btnDeleteRow",
});
[/code]
[code]
Kod
Name
[/code]
I placed the js code below in the "btnAddNewRowOk" click event and under "fnStartProcessingMode: function () {", regardless if I click cancel..it process and adds row :
[code]
if( !confirm('Are you sure that you want to submit the form')) {
return false;
}
[/code]
Is there a place I can add javascript to prevent adding a row when cancelled is clicked?
[code]
$('#cfo').dataTable( {
"sScrollY": "400px",
"bScrollCollapse": true,
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/Diplom/cfo",
"aoColumns": [
{ "sName": "ID",
"bSearchable": false,
"bSortable": false,
"bVisible": false
},
{ "sName": "KOD",
"sWidth": "10%"},
{ "sName": "NAME",
"sWidth": "90%"}
]
}).makeEditable({
"aoColumns": [
{ width: "80%" },
{ width: "80%" }
],
sAddNewRowFormId: "formAddNewRow",
sAddNewRowButtonId: "btnAddNewRow",
sAddNewRowOkButtonId: "btnAddNewRowOk",
sAddNewRowCancelButtonId: "btnAddNewRowCancel",
sDeleteRowButtonId: "btnDeleteRow",
});
[/code]
[code]
Kod
Name
[/code]
This discussion has been closed.
Replies
Allan