Search code examples
javascriptextjsextjs4extjs3

what is the similarity and difference between editable and readonly in javascript or extended java script?


Please define the similarity or difference between 'readonly' and 'editable' of java script/extended java script. Eg: if I declare readOnly: true and editable: false or vice versa, for any combo box,in ext-js, then how that combo will work.


Solution

  • Exactly as described in API documentation:

    http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.ComboBox-cfg-editable

    editable: False to prevent the user from typing text directly into the field; the field can only have its value set via selecting a value from the picker. In this state, the picker can also be opened by clicking directly on the input field itself.

    http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.ComboBox-cfg-readOnly

    readOnly: true to prevent the user from changing the field, and hides the trigger. Supercedes the editable and hideTrigger options if the value is true.