I have a form with the property extendsForm filled.
The onSearch of the extendsForm executes a block of code that I need in many forms but one of them needs some more code.
Can I do something like this:
lines of particular code for this form
.
.
.
DODEFAULT() // To execute the extendsForm code
or
DODEFAULT() // To execute the extendsForm code
lines of particular code for this form
.
.
.
Thanks in advance.
You can use the _super keyword to get access to the base form’s methods, so:
function doSearch() {
// do something here
_super.doSearch(); // calls the parent's method
// do some more stuff
}
Thanks Patrick, that is what I needed.
Note that you can also call any other method from the parent form using this construct, like:
function doSearch() {
// do something here
_super.doSearch(); // calls the parent's method
// do some more stuff
_super.anotherMethod();
}
Thanks again Patrick.
Since the function is _super.Method() and not just DefaultMethod() I supposed that but thank you very much. It´s better to give information that supposing that the others know it.
Do note that if you want to call the method on the super form with the same arguments as the overriding method, this is the syntax:
_super.methodName.apply(this, arguments);
You’ll see this syntax also in the automatically generated method templates when you override a method by clicking the specific method property in the form editor and you create a new method form there.
Paul