text tooltip markup initialization

I would like the text control to show its current value as tooltip, at all times.

text control markup initialization

<div view="text" id="nameText" label="{{translations.Name}}" 
value="{{perfilName}}"></div>

Things I have tried

  • js-based (on webix.ready handler):
$$('nameText').tooltip="#value#"

$$('nameText').tooltip = webix.ui({
                    view: "tooltip",
                    template: "#value#"
                });
  • markup-based:
<div view="text" id="nameText" label="{{translations.Name}}" 
value="{{perfilName}}">
  <config name="tooltip" template="#value#">
</div>

The task requires a bit more customization. The default tooltip settings of a text control allows to show a static HTML tooltip only.

To use the dynamic Webix tooltip you need to initalize it as a separate control and then bind it to onmouseover and onmouseout events of a text input: http://webix.com/snippet/7e12ece7

Same in JS, in case you need it: http://webix.com/snippet/fa29e1f1

Cheers for that. I have set up this http://webix.com/snippet/cb314c6d - the aim is to use the same tooltip both on the base page and on the modal window. There is an error in the snippet I cannot quite see.

Currently getting undefined $$(“t”) on the mouseover handler for the base page. As for the modal, looks like completeHtmlFormWConfig is never hit.

Markup and controller code both look fine to me, not sure what may be wrong. Can you help?

The error was related to the modal window. The tooltip handler assignment needs to happen once it is visible - http://webix.com/snippet/b99fd481

There is still an issue with tooltip positioning in the window - it behaves as if window.left and .top attributes were 0. How do I position the tooltip relative to the window?

You are trying to read window’s top and left properties directly in its object while they are stored in config ($$(“htmlWindow”).config). And it’s true for any properties of any Webix component.

http://webix.com/snippet/ff862196