Row within a Row with Ext GWT Grid

白昼怎懂夜的黑 提交于 2019-12-25 05:25:25

问题


Is is possible to have a RowExpander that is not HTML but rather another Row? That is, a row have a expand [+] icon then when expanded, sub rows appear like a "child-row""?

For example I have a List<ModelData> like this:

ModelData column1 = new BaseModelData();
column1.set("Date", "11-11-11");
column1.set("Time", "11:11:11");
column1.set("Code", "abcdef");
column1.set("Status", "OK");

ModelData column2 = new BaseModelData();
column2.set("Date", "11-11-11");
column2.set("Time", "12:11:11");
column2.set("Code", "abcdef");
column2.set("Status", "Failed");

ModelData column3 = new BaseModelData();
column3.set("Date", "11-11-11");
column3.set("Time", "13:11:11");
column3.set("Code", "abcedf");
column3.set("Status", "Failed");

ModelData column4 = new BaseModelData();
column4.set("Date", "11-11-11");
column4.set("Time", "14:11:11");
column4.set("Code", "abcdef");
column4.set("Status", "Failed");

List<ModelData> data = ...
data.add(model1);
data.add(model2);
data.add(model3);
data.add(model4);

And that this will be rendered in the Grid as two columns (Grouped by the Code and Status column):

         Date | Time     | Code   | Status
-------------------------------------
     11-11-11 | 11:11:11 | abcedf | OK
[+]  11-11-11 | 12:11:11 | abcedf | Failed
 |--->11-11-11 | 13:11:11 | abcedf | Failed
 |--->11-11-11 | 14:11:11 | abcedf | Failed   

Something like this.

Update:

I was advised that the solution would be to extends the RowExpander class and merge with GridView class.


回答1:


You can take a look at GroupingView and TreeGrid and customize one of them for you purposes. It is much safer than trying to reuse GridView's rows rendering functionality.



来源:https://stackoverflow.com/questions/13047545/row-within-a-row-with-ext-gwt-grid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!