PDA

View Full Version : DomHelper.createDom bug



tryanDLS
17 Nov 2006, 3:43 PM
Jack,

I was trying to do:


var dh = YAHOO.ext.DomHelper;
dh.useDom = true;
var x = dh.append('dlg', {tag:'div', style:'visibility:hidden'}, true);


createDom chokes trying to call this.applyStyles b/c scope is wrong - 'this' in createDom is pointing to window, not DomHelper. I think you might have to create a private 'me' var that's set to 'this' and use 'me' in the private methods to call public methods.

[/code]

jack.slocum
17 Nov 2006, 8:04 PM
I don't use me/that/self vars as they create circular references that IE's garbage collector doesn't aggressively collect. Instead I did:

YAHOO.ext.DomHelper.applyStyles(el, o.style);

I will probably be doing a check in later tonight if I can get the element.update code squared away.

tryanDLS
18 Nov 2006, 11:39 AM
aahh, I saw that someplace else where you explicitly used the classname within the class itself. Wasn't sure if it was an old artifact or intentional.

Learn something new every day :)