PDA

View Full Version : Execution stops after loading "requires"-property



aleksandy
2 Aug 2012, 8:14 PM
REQUIRED INFORMATION


Ext version tested:
Ext 4.0.7, 4.1, 4.1.1

Browser versions tested against:
IE8 FF14.01.1 (firebug 1.10.1 installed) Google Chrome 20

Description:
Application "Account Manager" from examples as basis.

At the root of the application create a directory for own namespace and put js-file to it. Add "requires"-property to config userlist.

After reload of page nothing happens but all files is loaded and console has no errors.

Steps to reproduce the problem:

Create new folder with name "myns" and put data.js file to it
Set path for "mynamespace" in Ext.Loader
Add requires-property in AM.view.user.List


The result that was expected:

"bar" in console
viewport on page


The result that occurs instead:

"bar" in console


Test Case:
index.html

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"></link>
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript">
<!--
Ext.Loader.setConfig({
enabled : true,
paths : {
'Ext' : 'extjs/src',
'mynamespace' : 'myns'
}
});
//-->
</script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>

data.js

(function(){
var foo = 'bar';
console.log(foo);
})();

app/view/user/List.js

Ext.define('AM.view.user.List' ,{
extend: 'Ext.grid.Panel',
requires : [
'mynamespace.data'
],
alias : 'widget.userlist',

title : 'All Users',
store: 'Users',

columns: [
{header: 'Name', dataIndex: 'name', flex: 1},
{header: 'Email', dataIndex: 'email', flex: 1}
]
});


HELPFUL INFORMATION

Screenshot or Video:
Console has no errors, all files is loaded.

37716

Operating System:
WinXP Pro

evant
2 Aug 2012, 8:28 PM
This isn't a bug. It's expecting a class called mynamespace.data.

aleksandy
3 Aug 2012, 12:53 AM
This isn't a bug. It's expecting a class called mynamespace.data.
You mean that data.js must contain Ext.ns('mynamespase.data') or Ext.define('mynamespase.data', {})? It's not logical.

I think in this case should be exception or message in console. At the worst this must be writen in documentation.