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

zkbinder $doAfterCommand get javascript error

    XMLWordPrintable

Details

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

    Description

      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]); }

      });
      })

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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