-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major
-
Affects Version/s: 9.6.3
-
Component/s: None
-
Security Level: Jimmy
-
None
User Story
As an app dev / support engineer, I want to modify the js code in za11y module without copy-paste or reverting the implementation, so that it's easier and less costly to override a function.
Acceptance Criteria
describe the final result from the owner's point of view to be counted as completed
Details
- override za11y module's functions without copying and pasting a target widget's code.
Current Way to override za11y functions
In order to call the widget's original method which is before overridden by za11y, I have to do one of the following things
- copy the widget's original method code into my patch js
- My custom logic needs to revert what za11y does first
//the existing code in za11y for Grid zk.override(zul.grid.Grid.prototype, _xGrid, { bind_: function () { _xGrid.bind_.apply(this, arguments); //za11y logic } });
//mypatch zk.override(zul.grid.Grid.prototype, _xGrid, { bind_: function () { _xGrid.bind_.apply(this, arguments); //call super method to run Grid's bind() in zul //revert what za11y does //implement my custom logic this.$supers(zul.grid.Grid, 'bind_', arguments); // call MeshWidget's bind_(), not Grid's bind_() } });
za11y is a new module which needs to be overridden more frequently than other modules.