0
votes

I have a grid with an editable text column and an editable boolean column.

    columns: [
        {
            dataIndex: '1',
            header: 'String',
            editor: {
                allowBlank: false
            }
        },
        {
            xtype: 'checkcolumn',
            header: 'Boolean',
            dataIndex: '2'
        }
    ],

I would like to do some checking before I allow someone to edit a cell, so I implement the beforeedit function like so :

    listeners: {
        beforeedit: function (e) {
            alert('hi')
        }
    }

The beforeedit fires when I try and edit a text column, but for a checkbox it does not.

Why?

Fiddle demonstrating my problem :

http://jsfiddle.net/S8Tgm/16/

1
i looked at checkchange event on the checkbox column. Works, but won't fire before the edit event. - Oliver Watkins

1 Answers

0
votes

Just figured it out :

            {
                xtype: 'checkcolumn',
                header: 'Boolean',
                dataIndex: '2',
                listeners: {
                    beforecheckchange: function() {
                        if (condition)
                            return false;
                    }
                }
            }

the checkcolumn needs a beforecheckchange listener.