Unselectable grid checkbox column

As a variable

var sm_og = Ext.create('Ext.selection.CheckboxModel',{
    checkOnly:true,
    listeners:{
       // prevent selection of records with invalid descriptions
       beforeselect: function(selModel, record, index) {
          if ((Ext.String.trim( record.get('x_field')) == '')) {
             Ext.Msg.alert('Please complete the record! ','You cannot check these rows until you complete x field.');
             return false; 
          } 
       }
   }
});

You can also add this to the class definition of the grid, by defining the "selModel" configuration setting.

Last update: Tue, 13 Sep 2022 14:32:15