making readOnly and editable editor based on condition