PDA

View Full Version : how to declare ext namespace in xslt?



wp.joju
4 Jul 2010, 10:22 PM
since the interceptTitles attribute of the tooltip doesn't work that smoothly in IE, i'm trying to manually add ext:qtip attributes to the appropriate html doms but the problem is if i do something like this in an xslt file, it will have an error prefix 'ext' is not defined



<xsl:attribute name="ext:qtip">
<xsl:value-of select="Description"/>
</xsl:attribute>

Condor
4 Jul 2010, 11:18 PM
You also have to register the ext namespace.

My XHTML header contains:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ext="http://www.extjs.com" xml:lang="en" lang="en">

(not using xslt that much, so I don't recall how to do that in xslt)

Condor
4 Jul 2010, 11:23 PM
You could also use:

Ext.onReady(function(){
Ext.select('*[title]').each(function(el){
var title = el.dom.title;
if (title && Ext.isString(title)) {
el.dom.removeAttribute("title");
Ext.QuickTips.register({
target: el.dom,
text: title
});
}
});
});
(might be slow with a large DOM)

wp.joju
4 Jul 2010, 11:44 PM
ok thanks, i think i'll go with the second solution even though it might be slower since i can do additional formatting to the title before showing it. I've looked around the forum regarding the interceptTitles problem in IE (title still showing on initial showing of ext tooltip) but haven't seen much about it, is it really an IE issue or am i doing something wrong?

wp.joju
4 Jul 2010, 11:50 PM
the selecting of titles and replacing it generally works for all elements in FF but again in IE, it doesn't work for select option items (drop down and listbox items)

Condor
4 Jul 2010, 11:55 PM
In IE, options are not part of the DOM (don't ask me why).

Can you even get QuickTips for <select> options in IE (without replacing them with Ext components)?