2012-10-24 38 views
0

可能有一個RowExpander不是HTML,而是另一個行?也就是說,一排有一個展開[+]圖標,然後展開時,子行看起來像一個「子行」,「行內的行與外部GWT網格

比如我有一個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); 

這這將在網格被呈現爲兩列(由CodeStatus柱分組):

  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 

像這樣

更新:

,我被告知,該解決方案是擴展了RowExpander類以及GridView類合併。

回答

0

您可以看看GroupingViewTreeGrid併爲您定製其中一個目的。這比嘗試重用GridView的行渲染功能要安全得多。