3.2.0

Disabling column resizing in 2.0

Does anybody have any ideas how I could selectively (for some columns and not others..) do this? Or, how I could, at least, turn all resizing off? Thanks very much.

Joe
Joe Hudson
November 5,
To disable all resizing, just hide all separators with:
.aw-grid-separator {display: none;}
I could'nt find a way yet to do it selective. Should be a function-header-template, but no luck.
HTH
Carlos
November 5,
Ok, thanks Carlos.

Joe
Joe Hudson
November 5,
Joe,
I just find a tricky way by css style definition:
document.styleSheets[document.styleSheets.length-1].addRule("#myGrid-separator-1-0" , "display: none;");
combine it with:
#myGrid .aw-column-1 {width: 150px; border-right: 1px dotted #ccc;}
and you get a column header (plus col-data) separator not-resizable.
HTH
Carlos
November 6,
Sorry replace "dotted" with "solid"
November 6,
Sorry, the first one only works in IE, for IE + Mozilla browsers you can define css inside style tags by:
#myGrid-separator-3-0 {display: none}

Or do it by scripting (single or loop after document.write(obj) )
document.getElementById('myGrid-separator-3-0').style.display = "none";

for( cs=0;cs<obj.getColumnCount();cs++) { 
document.getElementById('myGrid-separator-' + cs + '-0').style.display = "none";
 }
Carlos
November 7,
You could override the aw implementation of "onmousedown" event to disable column resizing. Also change the cursor css attribute for the .aw-grid-separator selector.

<style>
.aw-grid-separator {
cursor: default;
}
</style>

var obj = myGrid.getSeparatorTemplate();
obj.setEvent("onmousedown", function(event) { event = null; });

This will turn off resizing for all columns. If you want to do it selectively you'll have to determine the column in the mouse down event code above and only set the event to null where appropriate.
Take a look at the source file "separator.js"
BT
November 7,
Thanks a lot .. BT
Carlos
November 7,

This topic is archived.

See also:


Back to support forum