Extjs 6 How to use Promise in Proxy?

104 views Asked by At

I use a external library to fetch some data. To get some data I just type:

this.service.query(...args)

It returns a Promise<[]>.

What kind of a Exta.data.proxy.Proxy I should extend/use?

I don't want fetch date before and then create a Store with a memory proxy.

2

There are 2 answers

1
Subhadip Pal On

You can use a Ext.ajax.request, it returns a promise which you can use to create a store using Ext.create and store.loadData

0
norbeq On

There is no functional proxy for your needs, but in my opinion you should extend a Ext.data.proxy.Server.

You must override doRequest function. See Ext.data.proxy.Ajax for example (which is based on Ext.data.proxy.Server).