简体   繁体   English

使用GwtQuery处理JS事件

[英]Using GwtQuery to handle JS events

I have this JSNI code that I want to basically migrate to use plain Java, ie usign GwtQuery: 我有这个JSNI代码,我想基本上迁移为使用纯Java,即usign GwtQuery:

public static native void handleModalEvent(Element el)/*-{
    $wnd.$(el).on({
        'show.uk.modal': function(){
            $wnd.$("#new-placeholder").prepend($wnd.$(".g-r"));
        },
        'hide.uk.modal': function(){
            $wnd.$("#old-placeholder").prepend($wnd.$(".g-r"));
        }
    });
}-*/;

However I have tried to use the GwtQuery on() method. 但是,我尝试使用GwtQuery on()方法。 It would not work at all. 它根本不起作用。 However this JSNI code works really well. 但是,此JSNI代码效果很好。 Can anyone suggest the best GWT/GwtQuery based call for this method? 谁能为此方法建议最佳的基于GWT / GwtQuery的调用?

I think gwtquery doesn't accept '.' 我认为gwtquery不接受“。” In the name space. 在名称空间中。 Try "show.uk_modal" and "hide.uk_modal" it should work. 尝试使用“ show.uk_modal”和“ hide.uk_modal”。

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

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