PDA

View Full Version : 4.2.1 grid vs 4.2.2



Mark Wagoner
22 May 2014, 6:31 AM
We are in the process of upgrading from 4.2.1 to 4.2.2 and are experiencing problems with grid panels.

The first issue involves moving the focus into the grid. I have found that if I do not select a row in the grid first, it is not possible to move the focus into the grid using the tab key. If I add code to the callback function when loading the grid I can get around the issue by selecting the first row. This wasn't necessary in the previous version.



store.load({
scope: this,
callback: function (records, operation, success) {
if (!success) {
....
}
else {

// This was not previously necessary

if (store.count() > 0)
grid.getSelectionModel().select(0);
}
}
});


The other problem appears to be due to the grid no longer reacting to filter changes on the underlying store. Previously, changing the filter would cause a selectionchange event to fire if the selected record did not match the filter criteria. With the new version this no longer appears to the case. I now have to add code to select/deselect a row after the filter has been applied.



var store = grid.getStore();
store.clearFilter();

if (facilityId != 0)
store.filter('facilityId', facilityId);

if (sourceId != 0)
store.filter('sourceId', sourceId);

if (orderNo.length > 0)
store.filter('orderNo', orderNo);

// This was not previously necessary

if (store.count() > 0)
grid.getSelectionModel().select(0);
else
grid.getSelectionModel().deselectAll();


Is there some way to get the previous functionality without having to write additional code?

Thanks

Gary Schlosberg
22 May 2014, 9:24 AM
I see a few bugs in the tracker that look related, and they've all been recently fixed. Can you test against a nightly of 4.2.3 or 5.0.0?

Mark Wagoner
22 May 2014, 10:59 AM
I tried it against 4.2.3-20140521 and I still have the same problems

Gary Schlosberg
28 May 2014, 5:16 PM
As far as the first issue, perhaps this thread will help:
http://www.sencha.com/forum/showthread.php?249591

I did find a bug (EXTJS-13480 Grids and Trees should be in tab order) which seems to address this issue. It is currently unresolved, but has an increased priority and should get handled soon.

As far as the second issue, I found another bug (EXTJS-11896 Ext.selection.Model is not refreshing after a filter is applied in the store.) which seems to match. It too is unresolved, but there is a workaround posted to it:


Ext.define('RowModelOverride',{
override: 'Ext.selection.Model',
getStoreListeners: function() {
var me = this;
return {
add: me.onStoreAdd,
clear: me.onStoreClear,
bulkremove: me.onStoreRemove,
update: me.onStoreUpdate,
load: me.onStoreLoad,
idchanged: me.onModelIdChanged,
refresh: me.onStoreRefresh,
filterchange: me.onFilterchange
};
},
onFilterchange: function () {
this.refresh();
}
})