문제

All,

I have a JsonStore backing a form panel in my extjs app. I want to have the jsonStore load a single record based on an id value, but haven't found a good way to do that yet, and still keep the url restful.

My first attempt was to add a param to the jsonstore load() method with the id in it. That only adds the id as a request param, not attached to the url:

http://my-app/users/?id=123

instead of what i want:

http://my-app/users/123

Can someone help me out with this?

도움이 되었습니까?

해결책

You can manually construct the URL that the store uses to query for data (via the implicit HttpProxy it creates for the URL). So your loading function would look like:

function store_refresh() {
  json_store.proxy.conn.url = 'http://my-app/users/' + user_id;
  json_store.reload();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top