Failed to execute 'querySelectorAll' on 'Element' in ExtJS 5

风格不统一 提交于 2019-12-11 08:49:13

问题


I am trying for using Ext.dom.Query.Select method to find all divs which having class name square and highlightedReactangle.Same method was working with extjs 4 , but after up grading to extjs 5 it start throwing error.

Uncaught SyntaxError: Failed to execute 'querySelectorAll' on 'Element': 'div:any(div.square|div.highlightedReactangle|div.highlightedReactangleIE|div.pin|div.redCircleCount|div.stampPreviewCls)' is not a valid selector.

The statement I'm using to find related div is,

this.el.select("div:any(div.square|div.highlightedReactangle|div.highlightedReactangleIE|div.pin|div.redCircleCount|div.stampPreviewCls)", true);

what exactely I'm missing ?


回答1:


what exactely I'm missing ?

From version 5, when select is called on Element (versus explicitly using Ext.dom.Query.select), Ext JS uses the native querySelectorAll method which requires valid CSS selectors. As the error message suggests, your selector is not a valid one.

In version 4, Ext JS used Ext.dom.Query.select for processing select calls on Elements. That method is more "liberal" than querySelectorAll. It will work in version 5 as well, so you can just use:

Ext.dom.Query.select(your_selector, this.el.dom)


来源:https://stackoverflow.com/questions/32305687/failed-to-execute-queryselectorall-on-element-in-extjs-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!