简体   繁体   English

Ext GWT网格中的一行

[英]Row within a Row with Ext GWT Grid

Is is possible to have a RowExpander that is not HTML but rather another Row? 可以有不是HTML而是另一行的RowExpander吗? 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: 例如我有一个List<ModelData>像这样:

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): 并且这将在网格中显示为两列(按“ Code和“ Status列分组):

         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. 有人告诉我解决方案是扩展RowExpander类并与GridView类合并。

You can take a look at GroupingView and TreeGrid and customize one of them for you purposes. 您可以查看GroupingViewTreeGrid并自定义其中之一。 It is much safer than trying to reuse GridView's rows rendering functionality. 这比尝试重用GridView的行呈现功能要安全得多。

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

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