Mercurial > pub > ImplabJs
diff core/src/js/data/StatefullStoreAdapter.js @ 29:acdcdf1a8d21
repository reorganized
author | cin |
---|---|
date | Tue, 26 Jun 2018 19:35:44 +0300 |
parents | src/implab/data/StatefullStoreAdapter.js@93fb6c09f2e1 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/src/js/data/StatefullStoreAdapter.js Tue Jun 26 19:35:44 2018 +0300 @@ -0,0 +1,19 @@ +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; + } + }); + +}); \ No newline at end of file