3.2.0

grid doctype

I am coding a web application and there are some other components that require a doctype to be specified. I used the <!DOCTYPE HTML> doctype (but any other one triggering standards mode will result in the same problem) on IE8. I am using version 2.5.6 of activewidgets, but with the latest trial version the same problem occurs.

What happens is that in IE i can edit cells and it generally works... except when entering a value with 2 characters in a cell (it gets truncated to 1 character). Any other number of characters works fine. Also if I edit a cell and delete the value to get a blank cell, nothing happens and the cell returns to its original value once it loses focus.
Cedric Mamo
June 13,
also, in firefox and chrome this problem did not occur, but the columns were all sized equally (setHeaderWidth didn't work)
Cedric Mamo
June 13,
<head>
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

</head>

Add the above code, it may help with your IE issue.
Xay
June 18,
I will try. Thanks
July 16,
While it did help with my IE issue, the grids work as expected there when I add that line, in firefox and chrome the header width problem still persists. Thanks anyway :)
Cedric Mamo
July 16,
Add this functions to your JS file

function getCSSRule(ruleName, deleteFlag) { ruleName = ruleName.toLowerCase(); if (document.styleSheets) { for (var i = 0; i < document.styleSheets.length; i++) { var styleSheet = document.styleSheets[i]; var ii = 0; var cssRule = false; do { if (styleSheet.cssRules) { cssRule = styleSheet.cssRules[ii] } else { cssRule = styleSheet.rules[ii] } if (cssRule) { if (cssRule.selectorText.toLowerCase() == ruleName) { if (deleteFlag == 'delete') { if (styleSheet.cssRules) { styleSheet.deleteRule(ii) } else { styleSheet.removeRule(ii) } return true } else { return cssRule } } } ii++ } while (cssRule) } } return false }; function killCSSRule(ruleName) { return getCSSRule(ruleName, 'delete') }; function addCSSRule(ruleName) { if (document.styleSheets) { if (!getCSSRule(ruleName)) { if (document.styleSheets[0].addRule) { document.styleSheets[0].addRule(ruleName, null, 0) } else { document.styleSheets[0].insertRule(ruleName + ' { }', 0) } } } return getCSSRule(ruleName) };


Then use this when setting the width of the field

getCSSRule("#myGrid .aw-column-1").style.width = "160px";

where "myGrid" is the ID of your grid
Xay
July 16,
Thanks for your reply. It partially worked though. While the headers' size were changed the cells in the column were not (so the cells were not aligned with the headers)
Cedric Mamo
July 27,

This topic is archived.

See also:


Back to support forum