PDA

View Full Version : [FNR] ColumnConfig set resizable to false problem



hamdi
2 Feb 2011, 2:19 AM
Hi,
I'm working with GXT 2.1.1 in hosted mode, Win7, FF and IE.
It seems that I cannot disable column resizing.
Analyzing a little bit the GXT code, I found this (ColumnHeader.java):



// find the previous column which is not hidden
int before = activeHdIndex - 1;
for (int i = activeHdIndex; i >= 0; i--) {
if (!cm.isHidden(i)) {
before = i;
break;
}
}


Then :



if (x - r.left <= hw && cm.isResizable(activeHdIndex - before)) {
bar.el().setVisibility(true);
el().setX(r.left);
ss.setProperty("cursor", GXT.isSafari ? "e-resize" : "col-resize");
} else if (r.right - x <= hw && cm.isResizable(activeHdIndex)) {
el().setX(r.right - (hw / 2));
bar.el().setVisibility(true);
ss.setProperty("cursor", GXT.isSafari ? "w-resize" : "col-resize");
} else {
bar.el().setVisibility(false);
ss.setProperty("cursor", "");
}


I have two adjacent columns with index 4 and 5 (0 based) that are configured to be not resizable. The problem comes when the mouse cursor moves from column 5 header toward the column 4 header, so (x - r.left <= hw) is true. When debugging, I found that 'activeHdIndex' and 'before' have the same value 5. This is the first thing I don't understand because 'before' should be 4 (previous column which is not hidden).
The second thing I don't understand is why the code is trying to check if the column with index (activeHdIndex - before) is resizable. In my case, it will check if column 0 (or column 1 if before have the value it should have) is resizable or not. I was expecting the check of resizability of column with index 'before' (and not activeHdIndex - before).

Thanks in advance.

sven
13 Sep 2011, 5:11 AM
There was a fix for something like this on the 12th oh may. Can you retest this against the latest version?

hamdi
15 Sep 2011, 1:24 AM
Haven't tested yet, but indeed, current code seems more logical to me.