JsonQueryRestStore.js 1.1 KB

123456789101112131415161718192021222324252627
  1. /*
  2. Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. if(!dojo._hasResource["dojox.data.JsonQueryRestStore"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
  7. dojo._hasResource["dojox.data.JsonQueryRestStore"] = true;
  8. dojo.provide("dojox.data.JsonQueryRestStore");
  9. dojo.require("dojox.data.JsonRestStore");
  10. dojo.require("dojox.data.util.JsonQuery");
  11. dojo.requireIf(!!dojox.data.ClientFilter,"dojox.json.query"); // this is so we can perform queries locally
  12. // this is an extension of JsonRestStore to convert object attribute queries to
  13. // JSONQuery/JSONPath syntax to be sent to the server. This also enables
  14. // JSONQuery/JSONPath queries to be performed locally if dojox.data.ClientFilter
  15. // has been loaded
  16. dojo.declare("dojox.data.JsonQueryRestStore",[dojox.data.JsonRestStore,dojox.data.util.JsonQuery],{
  17. matchesQuery: function(item,request){
  18. return item.__id && (item.__id.indexOf("#") == -1) && this.inherited(arguments);
  19. }
  20. });
  21. }