4

I have a grid with check-box model and I want to disable some of the check-boxes on certain condition.

  1. Don't want to use renderer to override the DOM element.
  2. Want to do something like this.....

    grid.getStore().load({          
      scope: this,          
      callback: function(records, operation, success) {            
        if (success) {              
          var sm = grid.getSelectionModel();              
          Ext.each(records, function(record) {                
            if (record.data.chkd) {
              var row = record.index;
              // console.log(record.index);                  
              sm.select(row, true);                  
              // HERE WANT TO DISABLE THE CHECKBOX FOR THE PARTICULAR RECORD
            }
          });              
        } else {              
          //alert(success);
          //console.log(operation.exception);
        }
      }
    });
    

Thanks in advance for your help!!

Gilsha
  • 14,431
  • 3
  • 32
  • 47
aswininayak
  • 933
  • 5
  • 22
  • 39
  • By Using renderer we can disable these checkboxes but the problem is when we will try to use grid.getView().getSelectionModel().getSelection(); to get the selected records it wont work. So we have to manually check the records we selected... – aswininayak Apr 03 '13 at 13:43
  • 1
    I used checkcolumn and solved this as per this link http://stackoverflow.com/questions/10042052/extjs-checkcolumn-disable-for-some-rows-based-on-value – aswininayak Apr 24 '13 at 11:59
  • OP do you mind answering this question with your answer? – Akin Okegbile Jul 05 '19 at 15:33

0 Answers0