Created
August 21, 2012 15:01
-
-
Save sylvainfilteau/3416277 to your computer and use it in GitHub Desktop.
Warning when loading stores with Ext.application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('App.model.Bug', { | |
extend: 'Ext.data.Model', | |
fields: ['id', 'title', 'description'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('App.store.Bugs', { | |
extend: 'Ext.data.Store', | |
model: 'App.model.Bug', | |
proxy: { | |
type: 'ajax', | |
url: 'bugs.json', | |
reader: { | |
type: 'json', | |
root: 'data' | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
}); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": [{ | |
"id": 1, | |
"title": "first", | |
"description": "first desc" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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