condition to delete button
condition to delete button
Olan
Posts: 41Questions: 11Answers: 1
i want to have condition to the delete button. It would be nice if it is activated when a condition is met but otherwise only fires the delete action if condition is met is also good. I tried to make my own delete button but I cannot figure out how actually delete the selected row. For now I came up with:
{
sExtends: "select_single",
sButtonText: "MyDeleteButton",
fnClick: function( button, config ) {
var nodedata = this.fnGetSelectedData();
var status = nodedata[0].standuser.Status;
if (status === '2'){
//delete te row
}
}
},
If I put a alert in the if statement, it displayes the alart on the right rows. Now the delete action.....
Hope anybody can help me out with this one.
Thanks!
This discussion has been closed.
Answers
You could use:
(Assuming you are using Editor?).
Allan
Thank you Allen. Yes, i'm using editor.
Should I use your code inside my if statement?
If I do that, i receive the following error:
TypeError: this.i18n[this.s.action] is undefined
label: this.i18n[ this.s.action ].submit,
It 'works' if i have also the original delete button in place, click on it, cancel the delete action and then click on my delete button.
My code now:
Thanks!
Olan
never mind! This worked! Thanks!