PDA

View Full Version : Stores with remoteFilter and find*()



gbjk
22 Aug 2011, 6:00 AM
I'm using sencha touch 1.1.0.

I have a vehicle model, and my own proxy and reader which extend the respective Json versions.

My vehicle objects live in a server side database. The local store will just be a wrapper around the server.

I'm trying to model this sanely:
- Vehicle retrieve by id
- Vehicle find by other column
- Various non-crudish methods

Specifically I'm starting with a (hopefully) restful direction of:
/vehicle/$id
/vehicle/license/$license

I'm not sure how the hell I'm going to generically specify searches on compound keys restfully in a guaranteed order. Maybe i'll make the order ad-hoc, and hand that whole problem to my server's dispatcher, which I can control.

Does that URL construction look sane?
I can't see that it's done like this anywhere else, so I feel dirty forcing it in my proxy class.

On this basis, I now envision I should use the store (not the model) to interact with the backend.
store.load(ID123, function(){blah });
And:
store.find('license', LIC123)
Or:
store.filter('license', LIC123)

Am I going down the right path by using a store for this?

If so, then: How do I make the find respect the remoteFilter attribute?

I expect that I need to provide more information or clarify this further, but I'll wait to see what I'm missing when people reply :o)

Thanks!

Gareth