extjs 现代工具包-多重选择网格:如何在网格行选择中勾选多个复选框?

ef1yzkbh  于 2022-11-23  发布在  其他
关注(0)|答案(1)|浏览(127)

在现代的多选网格中,只有当我点击复选框时,多个复选框才会被选中。但我希望多个复选框在网格行选择时被选中。有人能建议吗?

raogr8fs

raogr8fs1#

在以下示例中,通过点击行来生成选择:

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,
    }
});

相关问题