Skip to content
Charles Llamas

How to disable a editable grid row by JavaScript

1 min read

This post is only available in English.

In order to lock a row/field in the editable grid you should follow the below steps:

  1. Open solution explorer.

  2. In the entity list, open the appropriate entity, select the Events tab.

  1. Add the JavaScript library in Form Libraries section.

  2. In the Event Handlers section, select OnRecordSelect option in Event field.

  1. Add the function disableEditableGridRow.

  1. The disableEditableGridRow code:
function disableEditableGridRow(context){
    var currentRow = context.getFormContext().data.entity;
    currentRow.attributes.forEach(function (attribute, i) {
        //add your custom conditions here
        var attributeToDisable = attribute.controls.get(0);
        attributeToDisable.setDisabled(true);
    });
}

You can add your custom conditions if you want to lock a specific fields in the row.

Related posts

Comments

No comments yet

No comments yet. Yours would be the first.

Leave a comment

Never published. Only used if I need to reply to you.

← All posts