| Summary: | Hiding column code in onRender of Table not working on Fedora | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | ankit <ankitvariousbugzilla> | ||||
| Component: | BIRT | Assignee: | Jianchao Li <jianchao.li> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | Xiaoying Gu <bluesoldier> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | bluesoldier, jianchao.li | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 3.7.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
ankit
Created attachment 183186 [details]
rptdesign file containing the test code
rptdesign file containing the test code
Please refer to this forum post for more information http://www.birt-exchange.org/org/forum/index.php/topic/20720-adding-rowscolumns-to-table-at-runtime-based-on-the-results-returned-by-dynamic-dataset/page__view__findpost__p__69875 Use "visibility:collapse" to hide the table column and remove the space it takes. It works in Firefox and IE(8.0, 9.0). The "*display:none" attribute is to make the column hidden in previous IE versions including IE7. So that combine of these two attributes will hide the table columns perfectly in all Firefox and IE versions. Reopen this issue because of an regression issue that more columns are hidden by mistake. This reason for this issue is that the detail cells' styles are not set as "display:none" at render time, which should inherit from it's parent(the column element) at design time.
To solve this issue, please use the following script in the onPrepare method of the table:
cCount=this.getColumnCount();
i=0;
j=0;
isChosen="";
paramVal=params["paramSelectList"].value;
paramLength=params["paramSelectList"].length;
while(i<cCount){
while(j<paramLength){
if (this.getDataBindings()[i].name == paramVal[j].toUpperCase())
{
isChosen = "yes";
}
else
{
if (isChosen == "yes"){
isChosen = isChosen;
}
else{
isChosen = "no";
}
}
j++;
}
if (isChosen == "yes"){
this.getColumn(i).getStyle().display = "block";
}
else{
this.getColumn(i).getStyle().display = "none";
}
j=0;
i++;
isChosen = "";
}
|