【问题标题】:GWT Jquery Mobile Refresh list viewGWT Jquery Mobile 刷新列表视图
【发布时间】:2013-04-02 23:17:05
【问题描述】:

我在 GWT 中使用 AJAX 添加一些 ListView 项。

如果我在 Chrome 中使用控制台调用,则可以正常工作。

$("#basket").listview("refresh");

如果我在 Java 中调用以下函数没有任何反应:

public static native void refreshListView()/*-{
    $wnd.$( "#basket" ).listview( "refresh" );
}-*/;

我在 Java 中的 JSNI 语法有问题吗?

【问题讨论】:

    标签: gwt jquery-mobile jsni


    【解决方案1】:

    我在正确加载小部件之前调用了 refreshViewList。 这有效:

    item.addAttachHandler(new AttachEvent.Handler() {
    
          @Override
          public void onAttachOrDetach(AttachEvent event) {
              JQMUtil.refreshListView();
          }
        });
    

    【讨论】:

      【解决方案2】:

      你试过this

      public static native void refreshListView()/*-{
      $wnd.$($doc).ready(function($) { 
         $( "#basket" ).listview( "refresh" );
      });
      }-*/;
      

      【讨论】:

        猜你喜欢
        • 2012-02-17
        • 1970-01-01
        • 2014-03-30
        • 2011-11-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多