There is also one alternative approach more.
Code:Ext.ComponentQuery.query("htmleditor").length > 0
Printable View
There is also one alternative approach more.
Code:Ext.ComponentQuery.query("htmleditor").length > 0
The approach presented above works as expected but it has a performance problem, since it will navigate through all items, as shown below:Quote:
There is also one alternative approach more.
Code:Ext.ComponentQuery.query("htmleditor").length > 0
Ext.ComponentQuery.query uses Ext.ComponentQuery.filterByXType
Items passed to Ext.ComponentQuery.filterByXType:Code:filterByXType = function (items, xtype, shallow) {
if (xtype === '*') {
return items.slice();
}
else {
var result = [],
i = 0,
length = items.length,
candidate;
for (; i < length; i++) {
candidate = items[i];
if (candidate.isXType(xtype, shallow)) {
result.push(candidate);
}
}
return result;
}
}
CPA1158139's requirement is to know whether a HtmlEditor is presented on the page, so, in my opinion it's not good to navigate through all elements, although we are talking about milliseconds.Code:Ext.ComponentManager.getAll()
You two really is too brilliant, admire. Learning.....
Raphael, I agree with you on both the statements.
There might be another approach also. When you add an HtmlEditor on the page, you can set some global flag.
By the way, could you, please, clarify why you need to determine there is an HtmlEditor on the page or not? Just our of curiosity.
The thing is that:
After RaphaelSaldanha tell me the code,I put this code into a JS file, start running good, later reported the error: Ext is not defined, but I do have a reference to the Ext.Net. so I think if to determine what, if the page is not htmlEditor, do not need to load the code. In fact this does not work either, because Ext is not defined the problem still exists, the judgment function also need Ext. and then I had to take him the code manually modify the download of the SVN code, and then get the Ext.Net.dll do not appear the mistake in the original.
So, I also feel strange, why don't you just give RaphaelSaldanha'code directly modifications to the SVN, so we in the IE 11 when running htmlEditor on all OK.
Daniil, take a look on example #2: http://forums.ext.net/showthread.php...l=1#post227981Quote:
There might be another approach also. When you add an HtmlEditor on the page, you can set some global flag.
When I update to the latest svn version #6243, this problem does not change.
Can replace B by A in SVN?
B:
Code:onEditorEvent: function () {
if (Ext.isIE && !Ext.isIE11) {
this.currentRange = this.getDoc().selection.createRange();
}
this.updateToolbar();
}
A:
Code:onEditorEvent: function () {
if (Ext.isIE && !Ext.isIE11) {
var doc = this.getDoc();
if (doc.selection != null) {
this.currentRange = doc.selection.createRange();
}
}
this.updateToolbar();
}
They found a two frequent problems in the IE 11, NULL type error. The cursor will stay in the following location For reference only:
1、
2、Code:fireEvent: function(eventName) {
var args = Array.prototype.slice.call(arguments, 1); //here!
return this.doFireEvent(eventName, args);
},
Code:
getDoc: function () {
try {
return this.getWin().document; //here!
} catch (ex) {
return null;
}
},
getWin: function () {
var me = this,
name = me.id + "_IFrame",
win = Ext.isIE
? me.iframe.dom.contentWindow
: window.frames[name];
return win;
},
Raphael, I meant without overriding the Ext.ComponentManager's registerId. Just when an HtmlEditor is added to the page. Well, never mind at this moment.Quote:
@CPA1158139, the problem should be resolved with ExtJS 5.1.0, when I commit it to the SVN. Once I commit, I will let you know and we all could retest and confirm it is still reproducible or not. Apologize for the inconvenience.
Never mind.Daniil.Thank you for working so hard.
I have a little not too clear,about ExtJS 5.1.0, is the direct integration of ext.net packaging, and I also installed separately? Or just get SVN updates only?