Fiddle example: https://fiddle.sencha.com/#view/editor&fiddle/2700
Creating the most simple of examples that I could conjure, I'm not seeing the reason why this fiddle won't load the relatively referenced Simpsons.json file.
• Code taken directly from the first fiddle of this doc page:
https://docs.sencha.com/extjs/6.5.1/...rid.Panel.html
• And then referring to the fiddle doc:
https://docs.sencha.com/extjs/6.5.1/...roxy.Ajax.html
Code:
Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'phone'],
proxy: {
type: 'ajax',
url: 'Data/Simpsons.json',
reader: 'json'
}
// • Moved following data into: Data/Simpsons.json
// • converted data to valid json w/ double quotes
// data: [{
// name: 'Lisa',
// email: '[email protected]',
// phone: '555-111-1224'
// }, {
// name: 'Bart',
// email: '[email protected]',
// phone: '555-222-1234'
// }, {
// name: 'Homer',
// email: '[email protected]',
// phone: '555-222-1244'
// }, {
// name: 'Marge',
// email: '[email protected]',
// phone: '555-222-1254'
// }]
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [{
text: 'Name',
dataIndex: 'name'
}, {
text: 'Email',
dataIndex: 'email',
flex: 1
}, {
text: 'Phone',
dataIndex: 'phone'
}],
height: 200,
width: 400,
renderTo: Ext.getBody()
});