Hi !
I'm doing my first extj mvc app, so I can't talk about best practice...
In my app I try to Set readOnly for all form fields.
Controller function :
init: function() {
this.control({
'#ViewId':
{ click: this.onView }
});
},
onView: function(button) {
button.up('form').query('.field').forEach(function(field)
{
if
(field.inputEl) {
field.inputEl.dom.setAttribute('readOnly', true);
} else {
field.readOnly = true;
}
});
}
on Button click Event of my button is onView, in that i am findingOut the form and inthat and all fields.
on loop through am setting the readOnly to the fields.
Instead of using Read Only use disable based on your Requirements
Note: This Only sets the Element's rearOnly DOM attribute. while Setting readOnly = true,
but in Extjs 4.1/ MVC we cant hide the triggering a combo Box or Date (Extjs 4.1.1 Release Notes).To hide the trigger use hide Trigger.
