How to store data in php and get data from php?

Extjs 4 data store and php

  • I wanna know if it's possible to call php api like in extjs 3.x.x. Let me explain, I have a store and I want to get data from php : Ext.define('KY.store.watcherStore',{ extend: 'Ext.data.Store', model: 'KY.model.WatcherModel', proxy: { type: 'ajax', url : '/admin/rest/ksThresholdWatcher/loadAllRef', //reader: { // type: 'json' //}, } }); The url param calls ksThresholdWatcher.php method loadAllRef (I have a php rest api); but it never calls my php script. I'm stuck, I don't now how to do, all examples I see set url param like this url:'myPHP.php'. How can I make it work my way ?

  • Answer:

    You need to specify that the your proxy is type: 'rest' in the config. Here is an http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/restful/restful.html the restful way. http://edspencer.net/2011/02/proxies-extjs-4.html also has some good pointers on proxy usage. You can use the api proxy config item in 4.x.x to specify different sources for the different request operations (CREATE, UPDATE, DESTROY, READ).

user1167186 at Stack Overflow Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.