checks data in the input field
$$("querybuilder").validate();
You can validate the input value. For this you need to set the validate attribute of the field.
You can make use of the predefined validation rules:
webix.ui({
view: "querybuilder",
fields: [
{id:"fname", value:"First Name", type:"string", validate: webix.rules.isNotEmpty},
{id:"lname", value:"Last Name", type:"string"}
]
});
It is also possible to specify a custom rule for validation by defining a custom function:
function ageValidation(value) {
return webix.rules.isNumber(value) || Array.isArray(value)
}
webix.ui({
view: "querybuilder",
fields: [
{ id:"age", value:"Age", type:"number", validate: ageValidation },
{ id:"bdate", value:"Birth Date", type:"date" }
]
});
Back to top