PDA

View Full Version : [INFOREQ]3.3 Hidden Columns aren't being hidden



Steve Framstad
16 Jun 2010, 2:29 AM
I found that the following isn't hiding the columns correctly,

getColumnStyle : function(colIndex, isHeader) {
var colModel = this.cm,
colConfig = colModel.config,
style = isHeader ? '' : colConfig[colIndex].css || '',
align = colConfig[colIndex].align;

style += String.format("width: {0};", this.getColumnWidth(colIndex));

if (colModel.isHidden(colIndex)) {
style += 'display: none';
}

if (align) {
style += String.format("text-align: {0};", align);
}

return style;
}

if I change style += 'display: none'; to style += ';display: none;';
it works

evant
16 Jun 2010, 2:37 AM
I wasn't able to reproduce that using the SVN build. What revision are you on?

Steve Framstad
16 Jun 2010, 2:53 AM
I grabbed the whole branches\3.3.x
then i used jbuilder2.

evant
16 Jun 2010, 2:58 AM
Yes, at which revision.

Steve Framstad
16 Jun 2010, 3:01 AM
6759

evant
16 Jun 2010, 3:16 AM
Ok, I can't confirm it using the same build. How are you able to reproduce it?

Steve Framstad
16 Jun 2010, 3:22 AM
If you have a few mins I can show you directly via a gotomeeting screenshare:

https://www2.gotomeeting.com/join/473223883

evant
29 Jun 2010, 8:20 PM
Are you still seeing this issue? Again, still not able to reproduce it with the latest SVN.

Daniil
30 Jun 2010, 6:00 AM
Hello, evant!

I use 3.3.0 version.
The incorrect hiding of a grouped column appears when setting hideGroupedColumn=true for GroupingView and aling='left/center/right' for a Column (which is grouped then) at the same time.
I'm agree with Steve Framstad the reason of this is a bug in GridView.getColumnStyle.

if (colModel.isHidden(colIndex)) {
style += 'display: none';
}

if (align) {
style += String.format("text-align: {0};", align);
}

When we use hideGroupedColumn and align properties at the same time we have a style like, an example, "display: nonetext-align: center;". It seems there must be ";" between "none" and "text-align".

So, I looked the getColumnStyle function up in 3.2.1 version and saw the following code in GreedView.js:


getColumnStyle : function(col, isHeader){
var style = !isHeader ? (this.cm.config[col].css || '') : '';
style += 'width:'+this.getColumnWidth(col)+';';
if(this.cm.isHidden(col)){
style += 'display:none;';
}
var align = this.cm.config[col].align;
if(align){
style += 'text-align:'+align+';';
}
return style;
}

And it works fine.

I attached two screenshots for demostrating the issue.
I prepared the sample code based on the Grouping.html example but it doesn't works without my own fixes. So, I will post my sample in another topic to see how you - ExtJS team - will fix it:)

evant
30 Jun 2010, 6:21 AM
Right, it's ~grouping~ that causes the problem. The OP never specified this.