queryView

returns inner element/elements of a widget that correspond(s) to the defined parameters

object|array queryView(object|function|string config, [string mode] );
config
object|function|stringan object with search parameters, a function with the search logic or a string with the view type mode
stringoptional, the mode of search: "all","parent","self", see details
object|arraya view object or an array of view objects in the "all" mode

Example

// 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;
});

Related samples

Details

The possible modes of search are:

Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.