Background: If you need the background is like the following We have a grid solution in place for the HTML tables.
This HTML table can be resized, some columns can be made hidden, columns can be dragged and dropped to change their ordering.
This reapplication is done like the following - we paint all the HTML table and then on top of that we apply users settings from session, like hide this column and make another wider etc. This is all working fine.
Now we wanted to introduce "default settings" for particular pages. Like less needed columns can be default hidden and columns like description can be default wider and so on.
What we did was to read the default settings from a properties file and add them in the session when user first vists the page. So that our "reapplying" logic will pick the settings [we save them in a hidden variable on the page] and next working will be as it is in the above case.
But the settings are not getting applied for no apparent reason.
We do not get a JS error or anything.
The wierd this is that if we add one alert somewhere, the issue disappears and the default settings are applied properly. If we remove the alert, it does not work.
You are probably calling the code before it is ully rendered. You probably should be doing it on page load or the very last step before the body tag.
posted 13 years ago
found the error.. there was one onload function in some other JS that was overriding the settings.. since it was onload, it got called whatever else we tried to twick from the regular flow of method calls.