Our blazing fast Grid component built with pure JavaScript


Post by lesterleong »

Is there a way to selectively turn off cell editing for specific columns, based on the row record? For example if the row's record ID is 52, then columns B, C and E cannot be edited, etc.

I do see that there might be a way to do this by subclassing the Column class and overriding canEdit(), but I'd really want to avoid this, if possible.

Post by mats »

It's possible in our coming release, so if you have a license you can download our '-next' nightly build and use it. Look for beforeCellEditStart event:
/**
             * Fires on the owning Grid before editing starts, return `false` to prevent editing
             * @event beforeCellEditStart
             * @preventable
             * @param {Grid.view.Grid} source Owner grid
             * @param {Object} editorContext Editing context
             * @param {Grid.column.Column} editorContext.column Target column
             * @param {Common.data.Model} editorContext.record Target record
             * @param {HTMLElement} editorContext.cell Target cell
             * @param {*} editorContext.value Cell value
             */

Post Reply