returns inner element/elements of a widget that correspond(s) to the defined parameters
config | object|function|string | an object with search parameters, a function with the search logic or a string with the view type |
mode | string | optional, the mode of search: "all","parent","self", see details |
object|array | a view object or an array of view objects in the "all" mode |
// searches for an element with the specified properties
var element = $$("layout").queryView({ width: 100, height: 200 });
// searches for a certain view in the widget
var button = $$("layout").queryView({ view:"button" });
// or a shorter way with the string parameter
var button = $$("layout").queryView("button");
// searches for all entities of the specified view
var buttons = $$("layout").queryView({ view:"button" }, "all");
var buttons = $$("layout").queryView("button", "all");
// searches for all button elements and disables them
var btns = $$("layout").queryView({ view:"button" },"all").map(view => view.disable());
// searches for all elements the width of which is more than 100px
var elements = $$("layout").queryView(function(view){
return view.config.width > 100;
});
The possible modes of search are: