Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs checkColumn

Tags:

extjs

I see the example in ExtJS, but it seems the checkColumn doesn't update the XML. The API is also not so helpful. What I wanted to do is something like this. When the user clicks the checkbox in the grid it will send an AJAX request.

like image 870
hafizan Avatar asked Dec 13 '22 23:12

hafizan


2 Answers

columns: [{
        xtype: 'checkcolumn',
        width: 30,
        sortable: false,
        id: 'check1',
        dataIndex: 'check11',
        editor: {
            xtype: 'checkbox',
            cls: 'x-grid-checkheader-editor'
        },
        listeners: {
            checkchange: function (column, recordIndex, checked) {
                alert(checked);
                alert("hi");
            }
        }
    }
]

worked for me :)

like image 152
Punith Raj Avatar answered Dec 22 '22 17:12

Punith Raj


in extjs4 you can do this. there is the 'checkchange' event, so you can have something like this :

{
    header: 'State',
    dataIndex: 'STATE',
    xtype: 'checkcolumn',
    editor: {
        xtype: 'checkbox',
        cls: 'x-grid-checkheader-editor'
    },
    listeners: {
        checkchange: function(column, recordIndex, checked) {
            console.log(checked);
            //or send a request
        }
    }
}
like image 38
scebotari66 Avatar answered Dec 22 '22 17:12

scebotari66