disable onPreSubmit function while using editor.remove
disable onPreSubmit function while using editor.remove
Hi Allan,
Recently I noticed that error ' o.data.field-name ' undefined , which s being used in "events": {"onPreSubmit":{ }}. This happens only when I try to remove the row. How to fix it? Can I make onpresubmit function not to respond to delete row action , if so how?
Recently I noticed that error ' o.data.field-name ' undefined , which s being used in "events": {"onPreSubmit":{ }}. This happens only when I try to remove the row. How to fix it? Can I make onpresubmit function not to respond to delete row action , if so how?
This discussion has been closed.
Replies
Probably what you want to do is check `o.action` in your event to see if it is `create` or `edit` - if so, perform whatever action is needed.
Regards,
Allan
[code]
"events": {
"onPreSubmit": function ( o ) {
if(o.action=="create"||o.action=="edit"){....
[/code]
Now it works fine for me. thank you very much.
One more similar doubt.
Is it possible to display one field only for create and some other field only for edit.
[code]
"fields": [{
"label": "field1",
"name": "field1",
"type": "text"
},
{// to be used while creating only
"label": "field2",
"name": "field2",
"type": "text"
},
{/////to be used while editing only
"label": "field3",
"name": "field3",
"type": "text"
}]
[/code]
Thanking you
If you don't want the fields to be submitted in create as well, just use a different instance of Editor which is configured with the fields that you want.
Allan