Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PATCH for dstore/Rest #161

Open
voidstate opened this issue Nov 13, 2015 · 4 comments
Open

Support PATCH for dstore/Rest #161

voidstate opened this issue Nov 13, 2015 · 4 comments

Comments

@voidstate
Copy link

I am using a dStore/Rest-backed dGrid. When editing just one value in a row, it would be much more efficient and also safer if the store could make a PATCH request rather than a PUT request that contains the entire row.

grid.updateDirty( id, 'booleanColumn', true );
grid.save();
@kitsonk
Copy link
Member

kitsonk commented Nov 16, 2015

It would probably be better to support this as a different store than dstore/Rest. While there is no standard for RESTful services, the PATCH verb is not as widely supported and even when it is, the way it is used is often against the intent of the RFC.

@kfranqueiro
Copy link
Member

Either way, it would kind of suggest a new API for dstore too, right? (Or an additional option to put, to indicate partial updating rather than outright replacement which is what put typically does now.)

It's certainly something that's crossed my mind before (along with the fact that dstore and dgrid don't really accommodate partial item updates/re-renders currently).

@kitsonk
Copy link
Member

kitsonk commented Nov 16, 2015

I could see a situation where the consumer of the store wouldn't need/want to care how the data was persisted. My thought is that the API would remain the same for the store, but the implementation would determine if it could provide the description of the changes to the PATCH verb versus PUT. The store should do the "diff", not the consumer.

No matter what, it is not a straight forward enhancement.

Though it touches on the whole store API and the ability to notify consumers of "changes" only, so they can only invalidate and redraw certain parts of their display.

@kfranqueiro
Copy link
Member

I suppose that's a point (that the consumer doesn't need to care), but in some cases the consumer already knows the diff (e.g. dgrid/Editor) so why waste the store's time? The consumer would be able to say "I am telling you this is exactly what changed and only what changed" in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants