-
FEATURED COMPONENTS
First time here? Check out the FAQ!
How i can use onClickEvent and onDoubleClickEvent at the same time in a Window??
Hello MarioVitale,
You could use the following script:
<zk xmlns:w="http://www.zkoss.org/2005/zk/client">
<window border="normal" title="hello" id="mainWindow">
</window>
<script type="text/javascript">
zk.afterMount(function() {
jq("$mainWindow").click(function(e) {
var that = this;
setTimeout(function() {
var double = parseInt($(that).data('double'), 10);
if (double > 0) {
$(that).data('double', double-1);
return false;
} else {
alert("click");
}
}, 300);
}).dblclick(function(e) {
$(this).data('double', 2);
alert("double click");
e.stopPropagation();
});
});
</script>
</zk>
Hope it helps.
Best Regards,
Darksu
You can be in executing the operation button on your data to judge, if click has been performed, the button state set is not available; or you after the click, add a label control, a message, so need not worry about this problem the. I hope to help you.
----Signature---- sacredsun lead-acid battery is my love .
Darksu, i haven't a static id, beacuse i create a window with template. I have this situation:
<template name="children"> <window onclick="method1" ondoubleclick="method2"> </template>
Thanks
Asked: 2015-06-09 13:39:56 +0800
Seen: 24 times
Last updated: Jun 12 '15