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

zkbinder $doAfterCommand get javascript error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.0.1
    • 9.0.0
    • None
    • None

      Steps to Reproduce

      http://zkfiddle.org/sample/1h23j2b/4-test-zkbinder

      click the button

      Current Result

      got a js error

      Expected Result

      should not get any js error

      Debug Information

      Registers multiple callbacks with same command,
      the callback function of binder.after('cmd', fn) execute binder.unAfter('cmd', fn).
      causeĀ  "this._aftercmd[cmd]" changed during the for loop

      Workaround

      zk.afterLoad('zkbind', function() {
      var _xBinder = {};
      zk.override(zkbind.Binder.prototype, _xBinder, {
      $doAfterCommand: function (cmd, args)

      { var ac = this._aftercmd[cmd]; if (ac) ac = ac.slice(); for (var i = 0, j = ac ? ac.length : 0; i < j; i++) ac[i].apply(this, [args]); }

      });
      })

            Leon03 Leon03
            Leon03 Leon03
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified