Skip to content

Instantly share code, notes, and snippets.

@sylvainfilteau
Created August 21, 2012 15:01
Show Gist options
  • Save sylvainfilteau/3416277 to your computer and use it in GitHub Desktop.
Save sylvainfilteau/3416277 to your computer and use it in GitHub Desktop.
Warning when loading stores with Ext.application
Ext.define('App.model.Bug', {
extend: 'Ext.data.Model',
fields: ['id', 'title', 'description']
});
Ext.define('App.store.Bugs', {
extend: 'Ext.data.Store',
model: 'App.model.Bug',
proxy: {
type: 'ajax',
url: 'bugs.json',
reader: {
type: 'json',
root: 'data'
}
}
});
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'App',
appFolder: 'app',
stores: ['Bugs'],
launch: function() {
var app = this;
console.log('App loaded');
this.getBugsStore().load(function() {
console.log(app.getBugsStore().getCount());
});
}
});
{
"data": [{
"id": 1,
"title": "first",
"description": "first desc"
}]
}
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="extjs/ext-all-dev.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment