View Full Version : class loading suggestions written to console

15 Jan 2013, 7:43 AM
when not requiring classes used by ST I usually get the following:
ARN][Anonymous] [Ext.Loader] Synchronously loading 'Ext.dataview.DataView'; consider adding 'Ext.dataview.DataView' explicitly as a require of the corresponding class

problem is, I have many classes with inheritance and I never know in which class I should put the requires. I just try until it works. is there a way to know exactly which class I should put the requires statement in?

17 Jan 2013, 6:39 AM
You should only include the required components that your view is currently using as child items but you don't need to do the same for the component your view is extending.
For instance, if you are creating the view

Ext.define('My.view.Test', {
extend: 'Ext.DataView',
items: [
xtype: 'titlebar',
title: 'Hello'

you don't need to include the "Ext.DataView" component in your view requires array, but you have to include the "Ext.TitleBar".
If you see the warning message related to a particular component require missing but you don't know which class uses it, you can simply start to search for it in your project, and if a class uses it as an item or create it "on the fly" somewhere in the class code, this class needs to have it included in the requires array.

17 Jan 2013, 7:20 AM
i still think that if possible the message should be more specific...
when many classes are loaded I find it hard to pin point the exact class I need to add the requires in...

17 Jan 2013, 7:23 AM
I agree, there's no doubts it could be more specific.