Reputation: 3056
I'm using jqgrid and i'm setting a column disabled
or enabled
based on some conditions. So i have set property disabled
to empty or disabled
based on that condition.
What i'm getting is, in both the cases my column is disabled. So is there any way to disable the disabled property
Something like,
disabled=false or readonly=false
So that i can set both true
or false
based on that condition.
FYI, I'm setting value like this,
editoptions: { defaultValue: this.DefaultValue, disabled: this.IsReadOnly }
Upvotes: 0
Views: 817
Reputation: 222017
All unknown properties of editoptions
will be interpreted as attributes which values should be set. If you set attribute disabled
with any value it will be interpreted as disabled. Only some versions of web browser required to set the value of disabled
to "disabled"
(disabled="disabled"
). So the usage of disabled=""
should have the same meaning as disabled="disabled"
in the most web browsers. Absolutely the same rule have readonly
attribute.
If you don't want to disable the editing field (or to set it as readonly
) you need generate editoptions
which don't contain disabled
property (or readonly
property) at all.
Upvotes: 1