PDA

View Full Version : [CLOSED-492] Different (wrong?) autoLoad behavior in 0.98



Steffen Hiller
1 Nov 2010, 8:55 AM
I'm setting a load mask of a dataview's body element on "beforeload" of its store (which is configured to autoLoad).

As of 0.98, the dataview that the store belongs to isn't rendered yet at the time the beforeload handler is executed.

The best way to reproduce this is by adding


listeners: {
beforeload: function () {
console.log(Ext.ControllerManager.get('loans').listView.el);
}
}

to examples/kiva/app/views/List.js line 67.

It will fail with:


Uncaught TypeError: Cannot read property 'el' of undefined List.js:69



A workaround for now is to defer the beforeload code with 1ms.
But still, I would expect that it works like it worked before.

Thanks.

BrendanC
1 Nov 2010, 10:46 AM
Thanks for the bug report.

edspencer
1 Nov 2010, 1:43 PM
This is because the DataView hasn't been rendered at this point. Although we are integrating load masking behavior into the framework, you should perform a test (e.g. dataview.rendered) before trying to add a mask or change its appearance.

This didn't manifest itself previously as we deferred Store's autoLoad by 10ms - that's risky though as the rendering may not have completed by that time.

Closing this as it's not a framework bug

Steffen Hiller
1 Nov 2010, 2:22 PM
I see your point. I guess best solution is to not use autoLoad then, and load the store afterrender of the dataview.

edspencer
1 Nov 2010, 4:24 PM
I see your point. I guess best solution is to not use autoLoad then, and load the store afterrender of the dataview.

Yup, agreed