Changeset 252


Ignore:
Timestamp:
03/23/09 22:00:05 (9 years ago)
Author:
elemoine
Message:

add tests for LayerReader

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

Legend:

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

    r242 r252  
    3333GeoExt.data.LayerReader = function(meta, recordType) {
    3434    meta = meta || {};
    35     if(!(recordType instanceof GeoExt.data.LayerRecord)) {
     35    if(!(recordType instanceof Function)) {
    3636        recordType = GeoExt.data.LayerRecord.create(
    3737            recordType || meta.fields || {});
     
    5555     *
    5656     * Parameters:
    57      * layers - {Array({OpenLayers.Layer})}
     57     * layers - {Array({OpenLayers.Layer})} Array of layers.
    5858     *
    5959     * Returns:
     
    6464    readRecords : function(layers) {
    6565        var records = [];
    66 
    67         if (layers) {
     66        if(layers) {
    6867            var recordType = this.recordType, fields = recordType.prototype.fields;
    6968            var i, lenI, j, lenJ, layer, values, field, v;
    70             for (i = 0, lenI = layers.length; i < lenI; i++) {
     69            for(i = 0, lenI = layers.length; i < lenI; i++) {
    7170                layer = layers[i];
    7271                values = {};
    73                 for (j = 0, lenJ = fields.length; j < lenJ; j++){
     72                for(j = 0, lenJ = fields.length; j < lenJ; j++){
    7473                    field = fields.items[j];
    7574                    v = layer[field.mapping || field.name] ||
     
    8281            }
    8382        }
    84 
    8583        return {
    8684            records: records,
  • sandbox/elemoine/playground/tests/list-tests.html

    r241 r252  
    44  <li>data/FeatureStoreMediator.html</li>
    55  <li>data/LayerRecord.html</li>
     6  <li>data/LayerReader.html</li>
    67  <li>data/LayerStore.html</li>
    78  <li>data/LayerStoreMediator.html</li>
Note: See TracChangeset for help on using the changeset viewer.