PDA

View Full Version : Migration from 4.0.7 to 4.2.1 - TaskManager



lcarbonaro
17 Dec 2013, 8:18 AM
Looking into migrating an application from ExtJS version 4.0.7 to 4.2.1.

Getting:
TypeError: oldCard is null
Ext.TaskManager.stop(oldCard.task);
for the following code:

// Handle tab changes
onTabChange: function(tabPanel, newCard, oldCard, eOpts) {
Ext.TaskManager.stop(oldCard.task);
Ext.TaskManager.start(newCard.task);
}, // onTabChange

Yes, I have looked at docs for TaskManager - nothing about tab change or ontabchange. Only thing I found is that in 4.2.1 it is now Ext.util.TaskManager. Tried changing that, but still got the same error. It seems to be complaing about one of the function arguments - oldCard. Are these function arguments documented anywhere?

Can anyone perhaps point me to docs/fiddle that would shed some light on this?

Thanks.

lcarbonaro
17 Dec 2013, 10:49 AM
For what it's worth, this is how I have worked around the problem:

// Handle tab changes
onTabChange: function(tabPanel, newCard, oldCard, eOpts) {
if ( oldCard!==null ) {
Ext.util.TaskManager.stop(oldCard.task);
}
if ( newCard!==null ) {
Ext.util.TaskManager.start(newCard.task);
}
}, // onTabChange

Not sure it's the right (or any sort of) solution at all. Looks like more of a workaround to me.

Still don't understand why the error does not occur in version 4.0.7, so if anyone has any wisdom to share on this I'd appreciate it.