Can someone please verify this as well?
I have a few columns in my grid that I need to update via code when another column is updated. I can't let the user update this field because it is calculated.
I can't seem to update the value via code when I set the column to readOnly: true.
I had to leave it as readOnly: false and capture the keydown event to see if it was tab, or shift otherwise cancel the keystroke.
{
columnKey: "EstExtPrice",
required: true,
readOnly: false,
editorType: 'numeric',
defaultValue: 0,
editorOptions: {
maxDecimals: 2,
nullValue: 0,
maxValue: 99999999.99,
validatorOptions: getValidationOptions,
keydown: function (evt, ui) {
var key = ui.key;
if (key == 9 || key == 16) {
return true;
}
else {
return false;
I can update the values of the Numeric editors via code if set to readOnly and if they are on a form outside of the grid.
Is this expected behavior?
Hello,
I am having this exact problem. I moved the readOnly attribute to from the column setting down to the editorOptions as described.
I still am getting "undefined" assigned when I do this:
(I am trying to edit values in the editors while they are working in the same row-- editMode: cell)
var updating = $("#grid1").data("igGridUpdating"); var cellToUpdate = updating.editorForKey('columnKeyHere');
cellToUpdate is undefined.
If I do the exact same thing with a columnKey that I do not have set to readOnly, it grabs the editor as expected.
{ columnKey: 'Key1',editorOptions: { readOnly: true } },
Am I doing something wrong?
Thanks
Hi Michael,
If you have any other questions regarding the matter, please feel free to contact us.
Thanks for the simple answer. I overlooked that. I guess I assumed the editor inherited some properties from the column.
Thanks again.
Hello Michael,
The reason that you cannot update the editor value when the column setting is readOnly: true is that the igGridUpdating doesn't create an editor for this column.
If you want the editor to be created then use the readOnly setting of the editor itself.
Here is an example code:
readOnly: true,
validatorOptions: getValidationOptions
Hope this helps,Martin PavlovInfragistics, Inc.
Hi,
when readOnly: true, you should still be able to update cells via API, how exactly are you invoking the updating? I will follow up with more info on this
thanks
Angel