how to init/define pattern in protoUI

edited October 2018 in Technical questions
webix.protoUI({
  name:"isodate",
  $cssName: 'datepicker',
  defaults:{
    type:"text",
    icon:"calendar",
    placeholder:"yyyy-mm-dd",
    pattern:{ mask:"####-##-##", allow:/[0-9]/g} 
}, webix.ui.text);

pattern is attached to webix.ui.text through webix.extend, but i don't know how to make use of it.

Tagged:

Comments

  • edited October 2018

    Is below solution acceptable?
    Can it be merged in next webix version?

    this is around line 34477 in webix_debug.js in Webix 5.4

        webix.extend(webix.ui.text, {
            $init:function(config){
    //        if(config.pattern || (config.format && !this.format_setter)){
              if(this.defaults.pattern || config.pattern ||  (config.format && !this.format_setter)){
    

    and line 26727 in Webix 6.0.3

    var TextPattern = {
          $init: function $init(config) {
            if (this.defaults.pattern || config.pattern || config.format && !this.format_setter) {
    
  • edited October 2018

    Hello,

    We will consider adding such an improvement in the pattern code, thanks for suggesting.

  • edited November 2018

    The functionality was improved in 6.0.6 https://snippet.webix.com/1y49sj56.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!