Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <a href="http://docs.sencha.com/ext-js/4-1/#!/api/Ext.ux.CheckColumn-event-checkchange" rel="nofollow">checkchange</a> event from <code>Ext.ux.CheckColumn</code>. That gives the rowIndex.</p> <p><strong>EDIT</strong></p> <p>If you are doing much more development in 2.2 I would recommend that you upgrade. But if you cannot, you could always try adding an override, or extending <code>Ext.ux.CheckColumn</code> to include the later version events. I am sure that this code would have to be tweaked to make it compatible with 2.2 but here's an example of an override to include the needed events -- I realize that I am not even sure if 2.2 had the <code>Ext.override</code> method, you will have to check your docs (checkchange code comes straight from the 4.1 API):</p> <pre><code>Ext.override(Ext.ux.CheckChange, { constructor: function() { this.addEvents( /** * @event beforecheckchange * Fires when before checked state of a row changes. * The change may be vetoed by returning `false` from a listener. * @param {Ext.ux.CheckColumn} this CheckColumn * @param {Number} rowIndex The row index * @param {Boolean} checked True if the box is to be checked */ 'beforecheckchange', /** * @event checkchange * Fires when the checked state of a row changes * @param {Ext.ux.CheckColumn} this CheckColumn * @param {Number} rowIndex The row index * @param {Boolean} checked True if the box is now checked */ 'checkchange' ); this.callParent(arguments); }, /** * @private * Process and refire events routed from the GridView's processEvent method. */ processEvent: function(type, view, cell, recordIndex, cellIndex, e) { var me = this, key = type === 'keydown' &amp;&amp; e.getKey(), mousedown = type == 'mousedown'; if (mousedown || (key == e.ENTER || key == e.SPACE)) { var record = view.panel.store.getAt(recordIndex), dataIndex = me.dataIndex, checked = !record.get(dataIndex); // Allow apps to hook beforecheckchange if (me.fireEvent('beforecheckchange', me, recordIndex, checked) !== false) { record.set(dataIndex, checked); me.fireEvent('checkchange', me, recordIndex, checked); // Mousedown on the now nonexistent cell causes the view to blur, so stop it continuing. if (mousedown) { e.stopEvent(); } // Selection will not proceed after this because of the DOM update caused by the record modification // Invoke the SelectionModel unless configured not to do so if (!me.stopSelection) { view.selModel.selectByPosition({ row: recordIndex, column: cellIndex }); } // Prevent the view from propagating the event to the selection model - we have done that job. return false; } else { // Prevent the view from propagating the event to the selection model if configured to do so. return !me.stopSelection; } } else { return me.callParent(arguments); } }, }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload