DataTables .makeEditable: confirmation alert before adding new row

DataTables .makeEditable: confirmation alert before adding new row

cmanvacmanva Posts: 37Questions: 0Answers: 0
edited September 2013 in Plug-ins
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]

Replies

  • allanallan Posts: 63,504Questions: 1Answers: 10,471 Site admin
    The makeEditable plug-in is not part of the DataTables project - it is 3rd party software. You will have more luck asking on their project page, although I think it is deprecated software now.

    Allan
This discussion has been closed.