Editing second header makes headers jump about in FF3
Hi Alex,
I was trying to put an input box into the second header to allow filter text to be entered using AW 2.5.2.
It seems to work fine in IE6, but in FF3, the header scrolls about when the header is clicked and when onControlEditEnded for the input box is called.
Here's the code I'm using:
Try editing the second header in column 7 by clicking on it, for example.
When you edit it, the grid headers jump till column 7 is aligned with the right of the grid.
Now, type in some text and hit enter - the headers jump to column 1.
During this jumping about, the grid data remains at the same position, so the columns are no longer in sync with the headers (it syncs up again as soon as I use the scrollbars)
Using alerts, I was able to see that the layout is intact till obj.getHeadersTemplate(1, "center").refresh() is called.
Can you suggest alternate code or a fix that will not make the headers jump about ?
Thanks,
Ankur
I was trying to put an input box into the second header to allow filter text to be entered using AW 2.5.2.
It seems to work fine in IE6, but in FF3, the header scrolls about when the header is clicked and when onControlEditEnded for the input box is called.
Here's the code I'm using:
var obj = new AW.Grid.Extended;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText(["header1", "header2", "header3", "header4", "header5", "header6", "header7", "header8", "header9", "header10"], 0);
obj.setHeaderCount(2);
obj.setFixedLeft(0);
obj.setColumnCount(10);
obj.setRowCount(100);
obj.onHeaderClicked = function(event, col, header) {
if (header == 1) {
var inp = new AW.UI.Input;
obj.setHeaderTemplate(inp, col, 1);
obj.getHeaderTemplate(col, 1).onControlEditEnded = function() {
var text = this.getControlText();
obj.setHeaderTemplate(new AW.Templates.ImageText, col, 1);
obj.setHeaderText(text, col, 1);
obj.getHeadersTemplate(1, "center").refresh();
}
obj.getHeadersTemplate(1, "center").refresh();
}
}
document.write(obj);
Try editing the second header in column 7 by clicking on it, for example.
When you edit it, the grid headers jump till column 7 is aligned with the right of the grid.
Now, type in some text and hit enter - the headers jump to column 1.
During this jumping about, the grid data remains at the same position, so the columns are no longer in sync with the headers (it syncs up again as soon as I use the scrollbars)
Using alerts, I was able to see that the layout is intact till obj.getHeadersTemplate(1, "center").refresh() is called.
Can you suggest alternate code or a fix that will not make the headers jump about ?
Thanks,
Ankur
Ankur Motreja
July 31,