Skip to content

extendedmodel

David Spreekmeester edited this page Dec 2, 2014 · 1 revision

Extended Model

Set a field to required

Regular field

#!js
this.getField('field_name').allowBlank = false;

Image field

#!js
this.getField('field_name').allowBlank = false;
var ref = '../../../ImagePreview_' + this.getField('field_name').name;
Ext.each(this.formConfig[0].items[0].items, function(item){
	if (item.ref === ref) {
		item.allowBlank = false;
		return false;
	}
});
Clone this wiki locally