vendredi 13 septembre 2019

How to Bind checkBox selModel

I have a datagrid with one column as checkbox for selecting the rows. However I want to bind the selModel checkbox via dataIndex such that when it is 'true', all checkboxes are selected and if 'false' none are selected.

dataIndex does not work. Or is there any other way to do this? Please help with an idea.

Below is my code:

Ext.apply(this, {
            store: myStore(),
            hasAddButton: false,
            cls: this.cls + ' open-item-list',
            selModel: {
                selType: 'checkboxmodel',
                injectCheckbox: 2,
                checkOnly: true,
                ignoreRightMouseSelection: true,
                ***dataIndex: myApp.model.gridModel.SELECTED,***
                listeners: {
                    selectionchange: 'onItemsSelectionChange'
                }
            },
            scrollable: true,
            header: false,
            columns: [{
        text: 'Name',
        dataIndex: 'name'
    }, {
        text: 'Email',
        dataIndex: 'email',
        flex: 1
    }]
        });

Thank you guys.




Aucun commentaire:

Enregistrer un commentaire