// copy object references into IFRAME
var Active = top.Active;
var mouseover = top.mouseover;
var mouseout = top.mouseout;
var dispatch = top.dispatch;
// register IFRAME document
top.obj._docs.push(document);
// write the grid
document.write(top.obj);
// clean up
window.onunload = function(){
top.obj._docs.pop();
}
Active.Templates.Header.patch = function(){
var obj = this.prototype;
var div = obj.getContent("div");
div.setEvent("onmousedown", function(event){
this.action("startColumnResize", this, event);
});
};
Active.Templates.Header.patch();
Active.Controls.Grid.patch = function(){
var obj = this.prototype;
var startColumnResize = function(header, event){
var el = header.element();
var pos = event.clientX;
var size = el.offsetWidth;
var grid = this;
var doResize = function(){
var el = header.element();
var sz = size + event.clientX - pos;
el.style.width = sz < 5 ? 5 : sz;
el = null;
};
var endResize = function(){
var el = header.element();
if( typeof el.onmouseleave == "function") {
el.onmouseleave();
}
el.detachEvent("onmousemove", doResize);
el.detachEvent("onmouseup", endResize);
el.detachEvent("onlosecapture", endResize);
el.releaseCapture();
var width = size + event.clientX - pos;
if (width < 5) {width = 5}
el.style.width = width;
var ss = el.document.styleSheets[el.document.styleSheets.length-1];
var i, selector = "#" + grid.getId() + " .active-column-" + header.getItemProperty("index");
for(i=0; i<ss.rules.length;i++){
if(ss.rules[i].selectorText == selector){
ss.rules[i].style.width = width;
el = null;
grid.getTemplate("layout").action("adjustSize");
return;
}
}
ss.addRule(selector, "width:" + width + "px");
el = null;
grid.getTemplate("layout").action("adjustSize");
};
el.attachEvent("onmousemove", doResize);
el.attachEvent("onmouseup", endResize);
el.attachEvent("onlosecapture", endResize);
el.setCapture();
el = null;
event.cancelBubble = true;
};
obj.setAction("startColumnResize", startColumnResize);
};
Active.Controls.Grid.patch();
if (window.HTMLElement) {
var element = HTMLElement.prototype;
element.__defineGetter__("document", function(){
return this.ownerDocument;
});
}
This topic is archived.