Guys,
I used to be able to do simple form validation in the Sencha Touch by creating a model as follows:
Code:
Ext.define("Data.model.Base", {
extend: "Ext.data.Model",
fields: [{
name: 'display_name',
type: 'string'
},{
name: 'typeid',
type: 'int'
}],
validators: [
{type: 'presence', 'display_name',message:"Please enter a display name"},
{type: 'presence', name:'typeid',message:"Please select a type"}]
});
model =Ext.create('SystemData.model.ResourceInputBase',form.getValues());
errors = model.getValidation();
errors.isValid();
The issue is that errors.isValid is always returning true, even when the display_name is blank
Is there there something I need to adjust in the model? Or has the process completely been revamped to use a model view? If so is there a tutorial for the modern framework that I can reference?
Thanks