Changeset 259


Ignore:
Timestamp:
03/24/09 06:48:28 (9 years ago)
Author:
elemoine
Message:

add FeatureRecord (#28)

Location:
sandbox/elemoine/playground
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • sandbox/elemoine/playground/lib/GeoExt.js

    r242 r259  
    5959    if(!singleFile) {
    6060        var jsfiles = new Array(
     61            "GeoExt/data/FeatureRecord.js",
    6162            "GeoExt/data/FeatureReader.js",
    6263            "GeoExt/data/FeatureStore.js",
  • sandbox/elemoine/playground/lib/GeoExt/data/FeatureReader.js

    r42 r259  
    4747GeoExt.data.FeatureReader = function(meta, recordType) {
    4848    meta = meta || {};
     49    if(!(recordType instanceof Function)) {
     50        recordType = GeoExt.data.FeatureRecord.create(
     51            recordType || meta.fields || {});
     52    }
    4953    GeoExt.data.FeatureReader.superclass.constructor.call(
    50         this, meta, recordType || meta.fields
    51     );
     54        this, meta, recordType);
    5255};
    5356
  • sandbox/elemoine/playground/tests/data/FeatureReader.html

    r185 r259  
    1717            var fields = reader.recordType.prototype.fields;
    1818            // 2 tests
    19             t.eq(fields.items.length, 2, 'number of items is correct');
    20             t.ok(fields.items[0].name == 'foo' &&
    21                  fields.items[1].name == 'bar',
     19            t.eq(fields.items.length, 5, 'number of items is correct');
     20            t.ok(fields.items[3].name == 'foo' &&
     21                 fields.items[4].name == 'bar',
    2222                 'field values are correct');
    2323        }
  • sandbox/elemoine/playground/tests/data/FeatureStore.html

    r190 r259  
    1919            var fields = store.reader.recordType.prototype.fields;
    2020            // 2 tests
    21             t.eq(fields.items.length, 2, 'number of items is correct');
    22             t.ok(fields.items[0].name == 'foo' &&
    23                  fields.items[1].name == 'bar',
     21            t.eq(fields.items.length, 5, 'number of items is correct');
     22            t.ok(fields.items[3].name == 'foo' &&
     23                 fields.items[4].name == 'bar',
    2424                 'field values are correct');
    2525        }
  • sandbox/elemoine/playground/tests/list-tests.html

    r252 r259  
    11<ul id="testlist">
     2  <li>data/FeatureRecord.html</li>
    23  <li>data/FeatureReader.html</li>
    34  <li>data/FeatureStore.html</li>
Note: See TracChangeset for help on using the changeset viewer.