Search Support
-
Saroj PandaJanuary 31, 2017 at 8:06 am #3610
I have created custom CoachView by using the BPMExt-Control-Decimal.js file available in SPARK toolkit. Currently the default behavior of change event is working as expected, but I want to perform additional activities after the completion of the change event.
I tried redefining this.constructor.prototype.change method in inline javascript but then it ignores the function defined in JS and I don’t want to override the default expected implementation, instead I want to extend it further. (may be the last option)
Also I tried [bpmext.ui.addEventSubscription(“eventON_CHANGE”, function(){alert(“on change”)}, this);] but didn’t get it work.
I checked at methods listed in help link but not finding the right one, or may be confused.
What will be the best way to register additional behavior on change event of the control.
Regards,
Saroj
SPARK SupportFebruary 10, 2017 at 2:53 pm #3666HI Saroj,
Is there an issue with using the configuration option for an On Change event?
This can call myFunction() from the On Change event.
Regards,
Stephen P.
Tomáš NavrátilFebruary 16, 2017 at 4:02 pm #3743Hi Saroj,
you can extend default control functionality by wrapping original change handler in your custom method, that can contain the additional logic. See below an example of code to be appended to your control’s inline JavaScript that does exactly that:
// Get current coach view prototype. var proto = this.constructor.prototype; // Detect our extension flag, so the prototype is extended only once. if (!proto._extendedDecimal) { // Set extension flag. proto._extendedDecimal = true; // Get original change handler. var superChange = proto.change; // Assign new change handler. proto.change = function (event) { console.log('Extended Decimal Change Event Called'); // Call parrent change event. superChange.apply(this, arguments); // Add your additional logic here... }; }
Please let me now if it solves your problem.
Best regards,
Tomas
SPARK SupportFebruary 17, 2017 at 3:19 pm #3766Hi Tomas,
Thank you for the feedback.
I should note that this would be best to do by copying to a new toolkit, as any changes will be overwritten upon the upgrade of SPARK dependency. And, also note that modifications to the controls will be unsupported.
Regards,
Stephen P.
Saroj PandaFebruary 20, 2017 at 12:00 am #3770Hi Thomas,
Thanks for your code snippet. This surely seems will work. Currently, I’m working on other issues and will try this sometime later.
Hi Stephen,
I agree this handle should be in custom coach view extending the default ones
I’ll share more once I explore this
Regards,
Saroj
SPARK SupportFebruary 22, 2017 at 9:57 am #3796Hi Saroj,
I look forward to hearing your results.
Regards,
Stephen P.
-
|
You must be logged in to reply to this topic.