0
votes

I have a grid with checkbox model. I want to select grid only when I clicked in checkbox, right now it getting select even after clicking on cell or row. I tried checkOnly: true, but it didn't work.

Thanks for help.

1
could you please provide a sample code. - Naresh

1 Answers

0
votes

This is working in EXTJS 4 all version.

Ext.create('Ext.data.Store', {
    storeId:'simpsonsStore',
    fields:['name', 'email', 'phone'],
    data:{'items':[
        { 'name': 'Marge', "email":"[email protected]", "phone":"555-222-1254"  }
    ]},
    proxy: {
        type: 'memory',
        reader: {
            type: 'json',
            root: 'items'
        }
    }
});

Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    selType: 'checkboxmodel', // This for checkbox Model
    selModel: { 
        enableKeyNav: false,
        pruneRemoved: false,
        checkOnly: true // This for select only checkbox is clicked
    },
    store: Ext.data.StoreManager.lookup('simpsonsStore'),
    columns: [
        { text: 'Name',  dataIndex: 'name' },
        { text: 'Email', dataIndex: 'email', flex: 1 },
        { text: 'Phone', dataIndex: 'phone' }
    ],
    height: 200,
    width: 400,
    renderTo: Ext.getBody()
});