alltouch
15 Nov 2008, 11:00 AM
I have modified DomHelper's source code. Now it can get HTMLElement's object as argument to it functions.
Earlier:
ExtDomHelper.insertAfter( el , {'tag':'div' , 'html':'lol x2 :)'} ); - worked
ExtDomHelper.insertAfter( el , Ext.get('my') ); - didn't worked
Now:
ExtDomHelper.insertAfter( el , {'tag':'div' , 'html':'lol x2 :)'} ); - works
ExtDomHelper.insertAfter( el , Ext.get('my') ); - works
Modified function:
doInsert : function(el, o, returnElement, pos, sibling){
el = Ext.getDom(el);
var newNode;
if(this.useDom){
if(o.toString().substr(0,12) != '[object HTML')
newNode = createDom(o, null);
else
newNode = o;
(sibling === "firstChild" ? el : el.parentNode).insertBefore(newNode, sibling ? el[sibling] : el);
}else{
var html = createHtml(o);
newNode = this.insertHtml(pos, el, html);
}
return returnElement ? Ext.get(newNode, true) : newNode;
}
Guys, what can you say about it?
How can i ask Extjs developers to include it in next release? :)
Earlier:
ExtDomHelper.insertAfter( el , {'tag':'div' , 'html':'lol x2 :)'} ); - worked
ExtDomHelper.insertAfter( el , Ext.get('my') ); - didn't worked
Now:
ExtDomHelper.insertAfter( el , {'tag':'div' , 'html':'lol x2 :)'} ); - works
ExtDomHelper.insertAfter( el , Ext.get('my') ); - works
Modified function:
doInsert : function(el, o, returnElement, pos, sibling){
el = Ext.getDom(el);
var newNode;
if(this.useDom){
if(o.toString().substr(0,12) != '[object HTML')
newNode = createDom(o, null);
else
newNode = o;
(sibling === "firstChild" ? el : el.parentNode).insertBefore(newNode, sibling ? el[sibling] : el);
}else{
var html = createHtml(o);
newNode = this.insertHtml(pos, el, html);
}
return returnElement ? Ext.get(newNode, true) : newNode;
}
Guys, what can you say about it?
How can i ask Extjs developers to include it in next release? :)