ArrayReader-min.js 925 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
  7. readRecords : function(C) {
  8. var B = this.meta ? this.meta.id : null;
  9. var G = this.recordType, K = G.prototype.fields;
  10. var E = [];
  11. var M = C;
  12. for (var I = 0; I < M.length; I++) {
  13. var D = M[I];
  14. var O = {};
  15. var A = ((B || B === 0) && D[B] !== undefined
  16. && D[B] !== "" ? D[B] : null);
  17. for (var H = 0, P = K.length; H < P; H++) {
  18. var L = K.items[H];
  19. var F = L.mapping !== undefined && L.mapping !== null
  20. ? L.mapping
  21. : H;
  22. var N = D[F] !== undefined ? D[F] : L.defaultValue;
  23. N = L.convert(N);
  24. O[L.name] = N
  25. }
  26. var J = new G(O, A);
  27. J.json = D;
  28. E[E.length] = J
  29. }
  30. return {
  31. records : E,
  32. totalRecords : E.length
  33. }
  34. }
  35. });