Stopping a Extjs grid checkboxcolum from being selected based on a condition

Posted . Visible to the public.

This link shows how you do that.

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; 
           }  
       }
    }
});
Johan van de Merwe
Last edit
Johan van de Merwe