Overriding or extending methods that start with "_" (underscore)

It is sometimes useful for me to implement a new version of a webix method that starts with “_”. A good example is the _pattern() method of the “text” view.

The problem is that it will not work when I use the minified version of webix (ie: the non debug version). This is because all methods that start with “_” is obfuscated.

Is it possible to override these methods so that they also work with the minified version?

Thanks in advance…

Hello,

The minified build is based on the original Webix code and it’s not intended for any modifications (as well as the debug version).

We strongly not recommend overriding the core of the library and we won’t handle any issues caused by these changes.

Thanks for your reply.

I am NOT trying to modify any webix code (minified or debug).

I am trying to create custom components that are derived/inherited from webix components as described in http://docs.webix.com/desktop__custom_component.html

The examples in that article override methods and properties like defaults, $init, $getSize, $setSize, etc. I was just hoping that I could do that with a method like webix.ui.text.prototype._pattern() too.

Unfortunately, there’s no way to modify an existing ‘private’ method. But if we talk about the custom component, you can create your own method for any purpose.

As a tiny example, here’s the formatted text input with a custom value_setter:

http://webix.com/snippet/d8fa382e

This setter will automatically translate the value into the needed format. Also, the detailed process of creating a custom component is described in the corresponding article.

The result you can examine at our GitHub: https://github.com/webix-hub/components/tree/master/ribbon

Thank you, that is very helpful.