No editor.submit on remove
No editor.submit on remove
Hi
Strange, but on editor.remove there is no editor.submit generated.
Insert working ok, but not remove. There is no js error in console. The code is :
$('button#ToolTables_objektArsakTabell_1').on('click', function(e){
e.preventDefault()
var tt = window.TableTools.fnGetInstance( $(BasisObjektArsak.editor.s.domTable)[0] );
var selekterteObjektRader = tt.fnGetSelected();
tt.fnSelectNone(); //avselect for å unngå at remove kalles opp 2 ganger (2 gang med [[row_xx,row_yy]]
if(selekterteObjektRader.length == 1){
BasisObjektArsak.editor.message('Er du sikker på at du vil slette markerte raden ?');
BasisObjektArsak.editor.remove( selekterteObjektRader[0] , 'Slette raden',{
"label":"Slett" ,
"fn": function() {console.log("before submit"); BasisObjektArsak.editor.submit(); console.log("after submit");}}
);
return false;
}
....
return false;
});
From log in console:
before submit (own logging)
onPreSubmit event
after submit (own logging)
and nothing more (no onPostSubmit event, no onSubmitSuccess event…, no even onSubmitError event).
Html is generated propely with the form and all fields under .DTE_Form_Content.
Any idea why this is not working ?
Regards Mirek
Strange, but on editor.remove there is no editor.submit generated.
Insert working ok, but not remove. There is no js error in console. The code is :
$('button#ToolTables_objektArsakTabell_1').on('click', function(e){
e.preventDefault()
var tt = window.TableTools.fnGetInstance( $(BasisObjektArsak.editor.s.domTable)[0] );
var selekterteObjektRader = tt.fnGetSelected();
tt.fnSelectNone(); //avselect for å unngå at remove kalles opp 2 ganger (2 gang med [[row_xx,row_yy]]
if(selekterteObjektRader.length == 1){
BasisObjektArsak.editor.message('Er du sikker på at du vil slette markerte raden ?');
BasisObjektArsak.editor.remove( selekterteObjektRader[0] , 'Slette raden',{
"label":"Slett" ,
"fn": function() {console.log("before submit"); BasisObjektArsak.editor.submit(); console.log("after submit");}}
);
return false;
}
....
return false;
});
From log in console:
before submit (own logging)
onPreSubmit event
after submit (own logging)
and nothing more (no onPostSubmit event, no onSubmitSuccess event…, no even onSubmitError event).
Html is generated propely with the form and all fields under .DTE_Form_Content.
Any idea why this is not working ?
Regards Mirek
This discussion has been closed.
Replies
The very first thing that Editor does in the ajax call back hander is fire `onPostSubmit` and there is no condition on that. As such, I wonder if the Ajax request is even being made? Could you possible link me to the page showing the problem please?
Allan
As I wrote there is no onPostSubmit event, no onSubmitSuccess event… and so on. There is no ajax request generated att all and the remove form is showing after click on remove button.
Upgraded to 1.2.2 without any change.
Create is still working ok. Only remove has problem.
Regards Mirek
Allan
Mirek
Allan
I used validation onPreSubmit, and of the course forget that this validation is only usefull for create!
But interesting is that the error fired there (with this.error(....)) is not shown, probably because this is connected to the field, and remove box does not showing any field, so it´s impossible to show this error.
Any way, thank for your help.
Thanks for flagging this up - I'll mark this down to see if it can be improved - perhaps a extra parameter into the onPreSubmit to say explicitly what event is occurring.
Regards,
Allan