Get column type in ".refglobaloptions.OptionType;
Get column type in ".refglobaloptions.OptionType;

I would like to get the column type of a field in the preOpen event so that I can cancel editing on certain columns.
I am using Keys but I don't want to limit the user's ability to move around in the table.
The following code works but I suspect I am not using the correct API.
editor.on('preOpen', function (e, mode, action) {
var column = editor.field($editor.modifier().column);
// This works but I suspect I am not using the proper API.
var columnType = column.s.opts.type;
if (columnType == 'readonly')
return false;
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
FYI: The title on this question is messed up. It should be "Get column type in 'preOpen' "
Yep, you are going into the
field
object, which may change (but unlikely too). Another approach would be to check on thereadonly
attribute of the node, see hereColin
Okay, so...
get the column with
var column = editor.field($editor.modifier().column);
and get the readOnly attribute
using
$(column.input()).attr('readonly')
instead of
column.s.opts.type
Thanks.