Changing Combo background
Hi everyone
I have a grid with a column (column 3) that is entirely combos, set up using:
so the user can select a different value from the combo for each individual row.
In the header for this column I also have a combo (with the same values) which can be used to select a value that can be applied to all rows in the grid. This "set all" is done with a button also in the header that has:
If there are a few hundred rows, it takes some time for this "set all" to work (especially in IE), so what I am trying to do is change the background colour of the header combo so that the user is aware that the "set all" is actually working. In priciple the background color can be changed at the beginning of the "set all" and then changed back again at the end as follows:
Now the problem with this (in both IE and FF) is that the style change doesn't seem to happen because the function is already busy doing the loop. I can only get it to work by interupting the function with some "alert" statement after the style change and before the loop. Also, trying to pause the function (setTimeout) doesn't seem to work either.
Any ideas on how to force the style change at the beginning (and end)of the onControlClicked function would be gratefully recieved.
Will
I have a grid with a column (column 3) that is entirely combos, set up using:
obj.setCellTemplate(new AW.Templates.Combo, 3)
so the user can select a different value from the combo for each individual row.
In the header for this column I also have a combo (with the same values) which can be used to select a value that can be applied to all rows in the grid. This "set all" is done with a button also in the header that has:
value = headerCombo.getControlValue();
button.onControlClicked = function() {
for (i=0; i<obj.getRowCount(); i++) {
obj.setCellText(value,3,obj.getRowIndices()[i]);
}
};
If there are a few hundred rows, it takes some time for this "set all" to work (especially in IE), so what I am trying to do is change the background colour of the header combo so that the user is aware that the "set all" is actually working. In priciple the background color can be changed at the beginning of the "set all" and then changed back again at the end as follows:
document.getElementById('headerCombo-box').style.background = 'gray'
value = headerCombo.getControlValue();
button.onControlClicked = function() {
for (i=0; i<obj.getRowCount(); i++) {
obj.setCellText(value,3,obj.getRowIndices()[i]);
}
document.getElementById('headerCombo-box').style.background = 'white'
};
Now the problem with this (in both IE and FF) is that the style change doesn't seem to happen because the function is already busy doing the loop. I can only get it to work by interupting the function with some "alert" statement after the style change and before the loop. Also, trying to pause the function (setTimeout) doesn't seem to work either.
Any ideas on how to force the style change at the beginning (and end)of the onControlClicked function would be gratefully recieved.
Will
Will
April 3,