jej2003
11 Jan 2012, 2:38 PM
I'm trying to run the jsbuilders create command to build a jsb3 file but get the following error when I run locally:
undefined:0 TypeError: 'null' is not a constructor
if I deploy my app to a web server and run against the full address it works
index.html. Also if I change the stores:[] tag to the equivalent requires tag it seems to work (although with a more complex application I run into other issues). Anyone have any thoughts for how to solve this?
<html>
<head>
<title>Hello Ext</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>
app.js
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'HelloExt',
stores :[
'AutoCompleteStore'
],
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
title: 'Hello Ext',
html : 'Hello! Welcome to Ext JS.'
}
]
});
}
});
app/store/AutoCompleteStore
Ext.define('MyApp.store.AutoCompleteStore', {
extend: 'Ext.data.Store',
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'AutoCompleteStore',
proxy: {
type: 'ajax',
extraParams: {
format: 'json'
},
url: '/autocomplete',
reader: {
type: 'json',
root: 'matches'
}
},
fields: [
{
name: 'value'
},
{
name: 'highlightedValue'
}
]
}, cfg)]);
}
});
undefined:0 TypeError: 'null' is not a constructor
if I deploy my app to a web server and run against the full address it works
index.html. Also if I change the stores:[] tag to the equivalent requires tag it seems to work (although with a more complex application I run into other issues). Anyone have any thoughts for how to solve this?
<html>
<head>
<title>Hello Ext</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>
app.js
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'HelloExt',
stores :[
'AutoCompleteStore'
],
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
title: 'Hello Ext',
html : 'Hello! Welcome to Ext JS.'
}
]
});
}
});
app/store/AutoCompleteStore
Ext.define('MyApp.store.AutoCompleteStore', {
extend: 'Ext.data.Store',
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'AutoCompleteStore',
proxy: {
type: 'ajax',
extraParams: {
format: 'json'
},
url: '/autocomplete',
reader: {
type: 'json',
root: 'matches'
}
},
fields: [
{
name: 'value'
},
{
name: 'highlightedValue'
}
]
}, cfg)]);
}
});