view src/implab/data/StatefullStoreAdapter.js @ 19:8332e287d552

fix (click on cospas)
author nickolay
date Wed, 04 Oct 2017 21:05:21 +0300
parents 93fb6c09f2e1
children
line wrap: on
line source

define(["dojo/_base/declare", "dojo/_base/array", "../safe", "./StoreAdapter"], function(declare, array, safe ,AdapterStore){
    return declare([AdapterStore], {
        _attrs : null,
        
        constructor : function(opts) {
            safe.argumentNotEmptyArray(opts.attrs, "opts.attrs");
            this._attrs = opts.attrs;
        },
        
        mapItem : function(item) {
            var result = {};
            array.forEach(this._attrs, function(p) {
                result[p] = item.get(p);
            });
            return result;
        }
    });
    
});