Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5441

Provide a better way to override za11y module

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Major Major
    • 10.0.0
    • 9.6.3
    • None
    • Security Level: Jimmy

      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

      Current problems

      In order to run the widget's original method, 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
          }
      });
      

      za11y is a new module which needs to be overridden more frequently than other modules.

            jumperchen jumperchen
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: