Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何选择jquery小部件的所有子类_Jquery_Jquery Ui_Jquery Selectors_Widget - Fatal编程技术网

如何选择jquery小部件的所有子类

如何选择jquery小部件的所有子类,jquery,jquery-ui,jquery-selectors,widget,Jquery,Jquery Ui,Jquery Selectors,Widget,我有一个来自jquery小部件的自定义组件 $.widget("custom.component", { // Some code } 和扩展子组件 $.widget("custom.subcomponent", $.custom.component,{ // Some code } 问题是我如何选择文档中的所有组件,而不管它是custom.component还是custom.subcomponent $('.myWidgetComponentClass')我是否正确地理解了唯一的方

我有一个来自jquery小部件的自定义组件

$.widget("custom.component", {
  // Some code
}
和扩展子组件

$.widget("custom.subcomponent", $.custom.component,{
  // Some code
}

问题是我如何选择文档中的所有组件,而不管它是
custom.component
还是
custom.subcomponent

$('.myWidgetComponentClass')
我是否正确地理解了唯一的方法是将自定义类添加到我创建的每个组件中<代码>$(“:自定义组件”)对我无效。
$(“:自定义组件”)
语法无效。添加类肯定是最简单的方法。看看jQueryUI,每个小部件都可以通过它的组件类找到