-
19 Jul 2011 4:59 AM #1
[4.0.4]TreeStore with REST proxy does not use RESTful URL
[4.0.4]TreeStore with REST proxy does not use RESTful URL
Ext version tested:
- Ext 4.0.4
Browser versions tested against:- Chrome 14
Description:- When using a TreeStore with REST proxy, the URL format to request nodes is '/path_to_api/?<nodeParam>=<nodeId>' instead of '/path_to_api/<id>'
Steps to reproduce the problem:- Use a Ext.data.TreeStore configured with a Ext.data.proxy.Rest proxy to query a REST API.
The result that was expected:- The proxy builds a proper REST URL as described above.
The result that occurs instead:- The proxy builds a URL with query strings parameter instead.
Possible fix:- TreeStore load() method does not include the 'records' property in the options passed to its proxy. However, the REST proxy needs this parameter to get the record/node id to properly build the URL in the "/my_api/{id}" format. Merely adding 'records: [node]' to the options object (sorta) solves the problem. There still is a slight design issue here.
aka Seboss
-
27 Feb 2012 6:58 AM #2
any solutions in this case ? posible hack or hot fixes ?
-
27 Feb 2012 7:06 AM #3
I suggested a workaround at the end of the OP.
aka Seboss
-
28 Feb 2012 2:52 AM #4
-
28 Feb 2012 2:54 AM #5
The first post.
If memory serves, you have to hack into the load() method of Ext.data.TreeStore and make sure the options object have a "records" property like that:
But I'm not 100% sure about this, that was 7 months ago and I moved away from using Ext.data.TreeStore with a REST proxy.Code:options.records = [node];
aka Seboss
-
28 Feb 2012 7:34 AM #6
i moved too ... for ajax but still its some stupid action for eg. i create new node and ajax proxy after store.sync() execute edit method... its big joke for me...
or more wird i edited properly first time in second time proxy send data witch update 2 records...Code:submit : function(button) { var win = button.up('window'); var form = win.down('form'); var record = form.getRecord(); var values = form.getValues(); var store = this.getClassificationIndicatorsStore(); var parent = this.getClassificationindicatorsIndexTreepanel().getSelectionModel().getLastSelected(); if (record && record.data) { //form.getForm().updateRecord(record); store.getNodeById(record.data.id).set('text', values.text); } else { if(!parent){ parent = store.getRootNode(); } parent.appendChild({ text: values.text, parent_id: values.parent_id, }); parent.expand(); } store.sync(); win.close(); }
Edited
i run the same code on ext 4.1 b3 and tree store works perfect both of proxy ajax and rest, add new node generate POST method, edit PUT ...
@sencha make hotfix for tree store in ExtJs 4.0.7 ! pls.
-
2 Mar 2013 7:43 PM #7
Has this been fixed yet?
Has this been fixed yet?
If so, can anyone please explain me how to do this?
I have my Rest Service being called by the TreeStore with Query Strings every single time it asks for data to the server. I am getting a null response, since the service needs the params to be properly formatted for the Restful service. I have tried lots of things and getting nowhere.
Please somebody provide some help.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote