15 Jul 2008 4:15 PM #1
Dynamically Changing url of Data Store
When used with RESTful Web Service, I always use uri like this:
'/users/1/comments'. When the user selected changes, the uri is also changed like '/users/2/comments'.
But in current version of ExtJS, the url of data store is configed in creation time. When I want to refresh the data, the url cannot be changed!
I have two choice now:
1)use param to send the user id value, but it is not the RESTful way!
2)use Ext.Ajax.request and convert the data into arrray, then use ArrayReader in data store.
If we can dynamically changing url of data store, all thing become very simple.
15 Jul 2008 8:50 PM #2
Although there is no setter method for the url there should not be a problem changing it at runtime.
Try something like:
myDs.proxy.url = '/users/2/comments';Aaron Conran
17 Jul 2008 10:49 PM #3
Following the tip provided by @aconran, I use following code successfully:
myDs.proxy.conn.url = '/users/2/comments'