【问题标题】:Get all the Records from GXTGrid从 GXTGrid 获取所有记录
【发布时间】:2013-09-17 14:39:41
【问题描述】:

//我的网格

ListStore< PojoSurveyReportApproved> store = new ListStore< PojoSurveyReportApproved>(loader);  
List<ColumnConfig> configs = getSurvey(list);  
cm = new ColumnModel(configs);  
cp = new ContentPanel();    

final Grid< PojoSurveyReportApproved> grid = new Grid< PojoSurveyReportApproved>(store, cm);    
grid.setTitle("ddddddd");     
grid.setBorders(true);     
grid.getAriaSupport().setDescribedBy(toolBar.getId() + "-display");    
cp.removeAll();   
cp.add(grid);   

这是我的网格,动态加载。每当它发生变化时,应该检索网格中的所有记录,我可以轻松地将其导出到 Excel。

我只想将网格中的所有记录作为数组或列表,是否有任何侦听器来处理它或我可以获取所有记录的任何方式。

我已经在某些方面进行了尝试,通过向商店添加监听器并没有给我结果

【问题讨论】:

    标签: extjs gxt


    【解决方案1】:

    你有没有试过—— store.getAll(); ?

    此代码获取网格中的所有记录并作为集合返回。但是,根据您的需要,您可能需要使用另一个 arrayList 来使用存储值。

    【讨论】:

    • 你能不能更具体点@R.I.P,比如 ArrayList lis=store.getAll();
    • 这里我的商店是 com.extjs.gxt.ui.client.store.ListStore;
    • 对于com.sencha.gxt.data.shared.ListStore的listStore,代码如下:List&lt;PojoSurveyReportApproved&gt; listFromStore = store.getAll();您的商店应该有类似的东西。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-07
    • 2015-03-20
    • 2014-10-21
    • 2017-02-24
    • 1970-01-01
    • 1970-01-01
    • 2017-05-13
    相关资源
    最近更新 更多