uploader required true script error

When required is true in the uploader component a script error is raised, See https://snippet.webix.com/su2imywo

Uncaught TypeError: Cannot read property ‘isNotEmpty’ of undefined
at u.validate (validatedata.js:103)
at u.click (ImportMembers:40)
at Object. (core.js:357)
at Object.callEvent (eventsystem.js:56)
at y (customevents.js:7)
at HTMLBodyElement. (ready.js:56)

Hello @mdissel,
Please note that ui.uploader doesn’t have required:true property. This setting is used for form inputs. Therefore, you need to add separate rule:

rules:{
      "files":webix.rules.isNotEmpty
    },

Please take a look at the snippet:
https://snippet.webix.com/3tetx8oi

May I suggest a feature request? To be consistent with all the other form components.

@mdissel
also you can set validate:webix.rules.isNotEmpty instead of required:true

Thanks, the form elements are rendered to json with a serverside (c#) library. A single property for the same purpose is easier :wink:

A single property for the same purpose is easier
a hack is possible

webix.extend(webix.ui.uploader, {
  $init: function(config){
    if(config.required && !config.validate){
      config.validate = webix.rules.isNotEmpty;
    }
  }
});

https://snippet.webix.com/76175jau

Thanks!