PDA

View Full Version : [2.2] Ext.Element setAttribute (and ability to update qtip on the fly)



JamesC
8 Apr 2009, 11:46 PM
// element set attribute ns
Ext.override(Ext.Element, {
setAttributeNS : function(ns, att, value) {
if (this.dom.setAttributeNS) {
this.dom.setAttributeNS(ns, att, value);
} else if (this.dom.setAttribute) {
this.dom.setAttribute(ns + ":" + att, value);
}
}
});


Allows you to do: el.setAttributeNS("ext", "qtip", "My new qtip");

angelflaree
21 Aug 2009, 9:21 AM
Good. It works, but only when in the initial field config, I set qtip to blank


,qtip:''

If I set it to an initial string value, then after calling your function it still shows my initial qtip string.
BTW, I'm using EXT 3.0

mirton
14 Feb 2010, 4:24 AM
Any way to make this work on form fields (e.g. combobox)?

I already used this override to enable qtips on form fields:


Ext.override(Ext.form.Field,
{ afterRender : Ext.form.Field.prototype.afterRender.createSequence(function()
{
var qt = this.qtip;
if (qt)
{ Ext.QuickTips.register({
target: this,
title: '',
text: qt,
enabled: true,
showDelay: 20
});
}
})
});

Thanks.