</script>
</body>
</html>
While the width/height of the grid match the width/height of the parent DIV, the grid appears larger than the div block (the grid is clipped because the overflow is set to hidden). Tests have shown the width is greater by 8px and the height is greater by 4px. What further complicates this issue is a requirement to make the width 100%. Tests have shown with this setting, the overlap still occurs. Any ideas on what is causing this issue and how it can be corrected?
C. Bustamante
Friday, March 28, 2008
Your example is a little too lengthy to easily work out what's going on. I would suggest you try with a smaller example.
As far as the DIV/AW interaction is concerned, I'm working on AW grids within a DIV so I tried it with my own code. In the CSS style, I changed it to this - padding:0px; border:none;
And my AW code has - obj.setStyle("width", "100%")
obj.setStyle("height", "100%")
I don't set a style position for the grid.
It seems to work OK (looks the same, anyway. Of course, I can't see a border now). Note that I place the AW code in the DIV section. I.e. - <div id=two class= ...
<script>
AW code
</script></div>
Can you elaborate on what you are trying to do with the DIVs?
Anthony
Friday, March 28, 2008
The DOCTYPE which you are using activates 'standards-compliant' box model, which means the CSS width/height are applied to the element content (excluding border and padding, i.e. 8px/4px for AW controls) -
If you need the grid to fit the parent - add 4px/2px padding to the parent div (or, better, remove the doctype or change it to the one which triggers 'quirks' mode).
Alex (ActiveWidgets)
Monday, March 31, 2008
Alex, the problem appears for strict doc when you set the width to 100%. With the current version the grid has 4 px more than its parent whenever the width is set using style - so why don't you once for all fix the issue by accepting different unit in the setSize() could be "%", "em" or "px"?
Philippe Marzin
Monday, March 31, 2008
Thanks everyone for your comments. This doctype is required and so I went ahead and used the padding suggestion. Worked great.