Extjs checkColumn

I see an example in ExtJS, but it seems that checkColumn not updating XML. The API is also not very useful. What I wanted to do was something similar. When the user clicks the checkbox in the grid, he will send an AJAX request.

+4
source share
4 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 :)

+8
source

in extjs4 you can do this. there is a 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 } } } 
+5
source

You want to run an ajax request for a check change event. Or, if you are trying to use CheckboxSelectionModel in a grid, place the listener on rowselect to disable the ajax request.

0
source

if you want or want to run an ajax request for a check change event. I think this will help you.

 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) { Ext.Ajax.request({ url: 'abc.com/index.php', scope: this, params: { postData: postdata }, method: 'POST', success: function (a) { } }); } } ] 
0
source

Source: https://habr.com/ru/post/1302367/


All Articles