tooltip

sets a popup message next to the toggle button when a cursor points to it

string|boolean|function|object tooltip;

Example

// tooltip as a function
webix.ui({
    view:"toggle", onLabel:"Edit", offLabel:"Read",
    tooltip:function(obj){
        return (obj.value ? obj.onLabel : obj.offLabel) + " a record";
    }
});
 
// tooltip as a configuration object
webix.ui({
    view:"toggle", onLabel:"Edit", offLabel:"Read",
    tooltip:{
        template:"#label#", dx:10, dy:20
    }
});

Related samples

Details

If you define the tooltip as a function, it receives one parameter - the configuration object of the button.

If you define the tooltip as an object, you can configure the tooltip and define its template as a string or a function like in the previous two examples:

// tooltip as a configuration object
webix.ui({
    view:"toggle", value:"Edit",
    tooltip:{
        template:function(obj){
            return (obj.value ? obj.onLabel : obj.offLabel) + " a record";
        },
        dx:10, dy:20
    }
});
See also
Back to top