3.0 beta 2

getStyle('left') changes

In Beta 1, if I setStyle('left', 0) then later do a getStyle('left') it returned 0. In Beta 2, a value of 0 returns 0px which breaks all of my math formulas. In testing I found that the LEFT and TOP styles return a 'px' and the WIDTH and HEIGHT return exactly what I set them as, which is what I would expect them to return.
I would like to suggest that you change the LEFT and TOP back to returning exactly what was set and add another method the will return the value with it's unit type. This would keep the new stuff from breaking existing code.
Jim Hunter
November 9,
Jim,

this must be something else as I did not change generic get/setStyle methods. Most likely this is a conflict with some other method which assignes style with 'px' (using 'px' is obligatory in strict mode).

Alex (ActiveWidgets)
November 10,
OK, there is an even greater problem. It doesn't matter what you set the LEFT or TOP value to, when you doa get it will always append 'px' to the value. This is even true if you set the value to "50%". When you do a get, the value returned is "50%px". It doesn't seem to effect the actual placement of the control all the times, but sometimes it does break the placement and the control value defaults to 0.
Jim Hunter
November 10,
Does that mean the in strick mode you can not use a value like "50%" which currently works great?
Jim Hunter
November 10,
Yes! It is happening in setControlPosition, I forgot that I snuck that call into a generic placement routine that I had. If I just use setStyle it works fine but setControlPosition is what is causing the problem. I can work around this easily, now that I know what it is.
Jim Hunter
November 10,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.