日期:2014-05-16  浏览次数:20572 次

extjs 4 grid 选中行 只能选择checkbox框。
Ext.onReady(function() {
var sm = Ext.create('Ext.selection.CheckboxModel',{checkOnly:true});
/*  var selMod = new Ext.grid.CheckboxSelectionModel({ 
        handleMouseDown : Ext.emptyFn, 
                listeners : { 
                    "deselect" : { 
                        fn : function(e, rowIndex, record) { 
                         
                                recordIds.remove(record.data.id); 
                             
                            
                        } 
                    }, 
                    "select" : { 
                        fn : function(e, rowIndex, record) { 
                          
                                recordIds.push(record.data.id); 
                          
                        } 
                    } 
                } 
            });   */
    Ext.create('Ext.data.Store', {
    storeId:'simpsonsStore',
    fields:['name', 'email', 'phone'],
    data:{'items':[
        {"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
        {"name":"Bart", "email":"bart@simpsons.com", "phone":"555--222-1234"},
        {"name":"Homer", "email":"home@simpsons.com", "phone":"555-222-1244"},                       
        {"name":"Marge", "email":"marge@simpsons.com", "phone":"555-222-1254"}       &