Ext.define('EmpMgmt.store.Personnel', {
extend: 'Ext.data.Store',
alias: 'store.personnel',
model: 'EmpMgmt.model.Personnel',
fields: [
{ name: 'name' },
{ email: 'email' },
{ phone: 'phone' },
],
proxy: {
type: 'rest',
url: 'https://jsonplaceholder.typicode.com/users',
reader: {
type: 'json',
rootProperty: 'data'
},
},
launch: ()=> {
var yourStore = Ext.getStore('EmpMgmt.store.Personnel');
yourStore.load();
},
});
I want to load data from API manually but dont know exact way about how to approach it? I am newbie in sencha ext js
You can manually load your store using the ViewController and ViewModel of it's view. Assuming that you have a view like this:
In your viewModel you can do this:
And finally your ViewController can load the store manually:
Despite the code, I strongly recommend you to see more at the sencha's Documentation about Store, ViewModel and Controller.
If something isn't clear or you have more doubts, don't hesitate to ask!
Hope it helps!