Opened 11 years ago
Closed 8 years ago
#11766 closed defect (wontfix)
JsonRestStore.getIdentity(): order of precedence is wrong?
Reported by: | Simon Speich | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | DojoX Data | Version: | 1.5 |
Keywords: | JsonRestStore, getIdentity, newItem | Cc: | |
Blocked By: | Blocking: |
Description
When using store.newItem() either the client-side or the server-side generated id is used depending on the the server's response. If the server responds with a Location header in the POST, the Location is used as the id. But store.getIdentity() favors item.clientId over item.id, so the id in the Location header is never used, e.g.:
// currently (wrong?): getIdentity: function(item){ var id = item.__clientId || item.__id; if(!id){ return id; } ... },
Patch (order in first line changed):
getIdentity: function(item){ var id = item.__id || item.__clientId; if(!id){ return id; } ... },
Change History (3)
comment:1 Changed 11 years ago by
Owner: | changed from Jared Jurkiewicz to Kris Zyp |
---|
comment:2 Changed 9 years ago by
Please could anyone give more explanation to this issue? Is it not possible to get the newly assigned ID of the item by standard API?
comment:3 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
dojox/data is abandoned. Some dojox/data stores have been upgraded to use the Dojo Store API and can be found at https://github.com/kfranqueiro/dojo-smore.
I believe the order is correct. The identity, clientside, should never change as widgets like Grid cache and index by them. Reassigning to Kris to confirm.