webix.message positioning

Hi.

Is it possible to set the position of a webix.message? I want to display my error messages with this but I want them to appear near the component which is throwing the error (if any) to contextualize the error a bit better.

As is, the messages always appear in the top-right corner. I’ve tried using x/y and top/left. Neither work. Is there any way to do this?
Cheers.

Anyone?

webix.message can’t be reconfigured in such way. It can be shown only in the corner of the screen.

You can use popup instead

$$("popup").show( some.$view )

Will show popup next to the target component.

Thank you for the suggestion. This seems to fit with what I needed.

However, is there anyway to fit the width of the popup to the content? As is, the popup will always have 316px width, unless I specify otherwise. I’d like to fit the content, which is in this case a label.

The errors have to support multiple languages so I can’t set the popup size manually. Also, some error messages com directly from the server and may have highly variable widths.

As is:
http://webix.com/snippet/8599fb34

You can use template with autoheight

http://webix.com/snippet/49b38350

That fixes it for height but not width.

http://webix.com/snippet/bc9ba4e1

It looks fine in the first case because the text reaches the default width.

Ideally, I’d like to set a max width for the popup and if the content is less than that maximum, then it should adjust the popup to the content.

I came from extjs, where adjusting a parent to the child content was possible. Is the same possible here?

Edit: Also, autoheight breaks the popup if the button is at the bottom of the screen, as seen in http://webix.com/snippet/48867a59.

Another example of autoheight breaking: http://i.imgur.com/2rbFHfA.png

It is possible to adjust parent element to child element.
But it will not work if you need adjust parent element to the raw HTML content. ( at least it is not possible for now )

I can confirm issue with bottom position of popup and auto-height, it will be fixed in the next update.

Thank you. Is there an ETA or should I implement a workaround for now?

Webix 2.4 will be released in May. We may release an intermediate fix build earlier, at end of April.

@igorsousa: see also this thread requesting improvements to the documentation for webix.message.

I’ve updated to 2.3.14 but the issue of the popup breaking when the indicator is bottom still maintains.

Yes, the fix wasn’t included in Webix 2.3.14. It will go into the next update.

Just updated to 2.4 and the problem seems to still be present.

Hello,

The fix was not included into the latest version. As the workaround you can call show() method twice:

  • first call will render a window
  • the second will set position

win.show();

win.show(node);

http://webix.com/snippet/1d30211d

Thank you, the workaround works just fine.