Search code examples
extjsextjs3gridpanel

ExtJS 3.4.0 GridPanel conditional disabling of rows


I have a GridPanel with a CheckColumn. I need to disable the entire row if the checkbox is unchecked when data loads, preventing data modification entirely. I tried using the getRowClass method in the viewConfig as follows:

        viewConfig: {
            getRowClass: function (record, rowIndex, rowPrms, ds) {
                //If the Sign-Off checkbox is unchecked, disable entire row.
                if (record.get('signOff') == 0) return 'disabled-row';
            }
        }

This does not work. Any pointers?


Solution

  • I discovered that the checkColumn does not have a checkBox object in it. It only plays with various images of checkboxes checked/unchecked using css. I created my own disabled versions of checkbox images, added some custom css, and loaded them conditionally in the renderer of the checkColumn.Prototype. Problem solved!