1

I have to modify Datebox and CalendarPop (Calendar) components in the way that if I give them a particular date/dates the Calendar of Datebox would show those dates with the particular CSS (for instance dates of holidays).

I haven't done anything before with the widget extension. I already checked Datebox.js sources and have no idea how to override _initPopup() function, where zul.db.CalendarPop() is initialized.

Maybe there is another approach to achieve what I want or I am doing something wrong?

Any information will be greatly appreciated!

Robert
  • 5,278
  • 43
  • 65
  • 115
Justin
  • 51
  • 1
  • 5

1 Answers1

0

You can use zk.override() to override a ZK widget class.

For example,

(function () {
    var _oldPop = {};

zk.override(zul.db.CalendarPop.prototype, _oldPop, {
    setXXX: function () {
        // override XXX function here.
        _oldPop.setXXX.apply(this, arguments); // invoke the original one if needed.
    }
});

})();

As long as the overridden code can be run before that setXXX function invoked.

jumperchen
  • 1,463
  • 12
  • 27