View Full Version : [OPEN EXTJSIV-2459] [EXT-4.0.2 RC3] Checkbox select gives commitFn is not a function

Fredric Berling
8 Jun 2011, 3:58 AM
Presumed bug in Ext-4.0.2RC3

While using the Checkbox selectionModel and making a programatic select on a row by calling the "select" function it fails.

commitFn is not a function on row 372 in RowModel.js

The comparison there just fails since its undefined and compared to ==! false

// Allow the GridView to update the UI by
// adding/removing a CSS class from the row.
onSelectChange: function(record, isSelected, suppressEvent, commitFn) {
var me = this,
views = me.views,
viewsLn = views.length,
store = me.store,
rowIdx = store.indexOf(record),
eventName = isSelected ? 'select' : 'deselect',
i = 0;

if ((suppressEvent || me.fireEvent('before' + eventName, me, record, rowIdx)) !== false &&
commitFn() !== false) {

for (; i < viewsLn; i++) {
if (isSelected) {
views[i].onRowSelect(rowIdx, suppressEvent);
} else {
views[i].onRowDeselect(rowIdx, suppressEvent);

if (!suppressEvent) {
me.fireEvent(eventName, me, record, rowIdx);

Its being called by the onSelectChange from the CheckBoxModel which obviously does not include the presumed function

* Synchronize header checker value as selection changes.
* @private
onSelectChange: function(record, isSelected, suppressEvent) {
this.callParent([record, isSelected, suppressEvent]);
// check to see if all records are selected
var hdSelectStatus = this.selected.getCount() === this.store.getCount();

8 Jun 2011, 7:57 AM
I've run in to this bug also, except it doesn't happen on just programmatic selects. It's also happening when I try to select by clicking on a row.

8 Jun 2011, 9:34 AM
Thank you for the report, I'm investigating this now.

8 Jun 2011, 9:54 AM
confirmed, thank you again for reporting this, filed as EXTJSIV-2459

9 Jun 2011, 9:23 AM
This was manifesting itself in giving an error when you clicked on a row in a grid with checkboxselectionmodel. We've fixed that in source control now and are just preparing a 4.0.2 build. Stay tuned...