简体   繁体   English

如何在 ZK 的 Datebox 中将事件监听器添加到日历弹出窗口?

[英]How to add event listener to calendar Popup in Datebox in ZK?

How to add event listener to calendar Popup in Datebox in ZK?如何在 ZK 的 Datebox 中将事件监听器添加到日历弹出窗口?
'Datebox dateBox = new Datebox(dateObject);' '日期框日期框 = 新日期框(日期对象);'

There is no server-side event for opening a datebox popup by default.默认情况下,没有用于打开日期框弹出窗口的服务器端事件。 Since opening a popup is a pure client-side action and no data changed.因为打开一个弹出窗口是一个纯粹的客户端操作并且没有数据改变。 If you want to add a java listener, you can apply the attached js.如果要添加 java 监听器,可以应用附上的 js。 That js will override databox widget to send an onOpen event to the server when you click the calendar icon to open the popup.当您单击日历图标打开弹出窗口时,该 js 将覆盖数据框小部件以向服务器发送onOpen事件。 Then you can call然后你可以打电话

dateBox.addEventListener("onOpen", new EventListener<Event>() {...});

zk.afterLoad('zul.db', function() {
    var exWidget = {};
    zk.override(zul.db.CalendarPop.prototype, exWidget, {
        open: function(silent){
            exWidget.open.apply(this, arguments);
            zAu.send(new zk.Event(this.parent, "onOpen", null, {toServer:true}));
        },
    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM