extjsgridextjs6-modern

Modern Toolkit- Grid with Multiselection: How to make multiple checkboxes ticked on grid row selection.?


In modern multiselection grid, Multiple checkboxes getting ticked only when i click on checkbox. But i want multiple checkboxes to be ticked on grid row selection. Can anyone please suggest.


Solution

  • In the following sample the selection is produced by tapping on row:

    var grid = Ext.create('Ext.grid.Grid', {
        title: 'Streaming Service Providers',
        columns: [{
            text: "Brand",
            dataIndex: "brand",
            flex: 1
        }, {
            text: "Headquarters",
            dataIndex: "headquarters",
            flex: 1
        }, {
            text: "Trial",
            dataIndex: "trial",
            flex: 1
        }, {
            text: "Price",
            flex: 1,
            dataIndex: 'price'
        }],
        store: {
            fields: ['brand', 'headquarters', 'trial', 'price'],
            data: [{
                brand: 'Netflix',
                headquarters: 'California',
                trial: '1 Month',
                price: '$7.99'
            }, {
                brand: 'YouTube',
                headquarters: 'California',
                trial: '1 Month',
                price: '$9.99'
            }, {
                brand: 'Amazon Prime',
                headquarters: 'Seattle, Washington',
                trial: '1 Month',
                price: '$8.25'
            }],
            storeId: 'serviceStore'
        },
        height: 400,
        renderTo: Ext.getBody(),
        // Row checkbox selection model config
        selectable: {
            columns: false,
            mode: 'multi',
            checkbox: true,
            cells: false,
            rows: true,
        }
    });