Hello!
I understand ExtJS, with varying success ...
Neither can I accept on the server the data sent by the Store when records are changed (added, modified or deleted). Writes that the data goes to POST , but on the server neither $ _POST , nor $ _GET , nor $ _REQUEST sent data shows - as if nothing was sent (well, except for the random value in $ _GET - _dc = 1357565039902 ).
That's what goes to the server (taken from the Chrome console), respectively, when deleting, updating and adding:
Request URL: http://localhost/service/destroy/news.php?_dc=1357565811429 Request Method:POST Status Code:200 OK Query String Parameters: _dc:1357565811429 Request Payload: {"items":{"id":5}} Request URL: http://localhost/service/update/news.php?_dc=1357566047052 Request Method:POST Status Code:200 OK Query String Parameters: _dc:1357566047052 Request Payload: {"items":{"datepubl":"2012-12-01T00:00:00","title":"the Update Plan","alias":"the-update-plan","new":"<p>small text new</p>","newfull":"<p>full text new</p>","id":4}} Request URL: http://localhost/service/create/news.php?_dc=1357566179903 Request Method:POST Status Code:200 OK Query String Parameters: _dc:1357566179903 Request Payload: {"items":{"id":0,"datepubl":null,"dateclose":null,"title":"the NEW new","alias":"the-new-new","new":"text the NEW new","newfull":""}}
The following Store sends these requests:
var storeNews = Ext.create('Ext.data.Store', { autoLoad: true, autoSync: true, idProperty: 'id', remoteFilter: true, fields: [ { name: 'id', type: 'int' }, { name: 'datepubl', type: 'date' }, { name: 'dateclose', type: 'date' }, { name: 'title', type: 'string' }, { name: 'alias', type: 'string' }, { name: 'new', type: 'string' }, { name: 'newtext', type: 'string' } ], proxy: { type: 'ajax', api: { read: 'service/view/news.php', create: 'service/create/news.php', update: 'service/update/news.php', destroy: 'service/destroy/news.php' }, reader: { type: 'json', successProperty: 'success', root: 'data', messageProperty: 'message' }, writer: { type: 'json', writeAllFields: false, root: 'data' }, listeners: { exception: function(proxy, response, operation){ Ext.MessageBox.show({ title: 'REMOTE EXCEPTION', msg: operation.getError(), icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); } } } });
Can you please tell me how to accept the transferred data to the server?
Or how to send them correctly, if I do it wrong? ..