I try to give a mask for view: "text" in webix

 { view: "text", label: 'Телефон', width: 360, placeholder: "Телефон", name: "telephone" }, { view: "button", value: "Закрыть", width: 200, click: function () { $$("registrationForm").elements["telephone"].mask("(999) 999-9999"); } }, 

Probyval writes that the mask is not a function that I missed?

  • need more code - JK_Action
  • Where did the mask method come from ui.text? - JK_Action
  • This is the jquery method I connected it to - Aslan Kussein

2 answers 2

In webix version 3.4, view: "text" a pattern property. If you are using the latest version of webix, then in view: "text" you need to add the following:

 pattern:{ mask:"(###) ###-####", allow:/[0-9]/g } 

Example: http://webix.com/snippet/a15991a5

  • one
    The latest version of webix -a does not work - Aslan Kussein
  • If it is not possible to use the version of webix 3.4, then you can do it through the validate method of the view: "form" , for example, like this: webix.com/snippet/6a4c5ee6 . The validation rule needs a little correction, but the meaning is clear - Slide

This will not work well, webix api provides an abstraction of the widget. jquery works through DOM directly. You can tear out the DOM node, but this is a crutch. Use webix validation tools.