GWT Visualisation API DataTable Serialization

后端 未结 3 1083
终归单人心
终归单人心 2021-01-13 12:08

I am trying to follow this tutorial on how to connect to a database in GWT, but instead of creating a login program, I am trying to retrieve a GWT Visulation DataTable from

3条回答
  •  -上瘾入骨i
    2021-01-13 12:46

    I think you can do it

    on server side

    String json = JsonRenderer.renderDataTable(yourDataTable, true, true);
    

    and on client side use some thing like

    public static native DataTable toDataTable(String json) /*-{
      return new $wnd.google.visualization.DataTable(eval("(" + json + ")"));
    }-*/;
    

    I think it should work

提交回复
热议问题