annotate src/implab/data/StatefullStoreAdapter.js @ 0:fc2517695ee1

Initial commit, draft import of existing work
author cin
date Thu, 01 Jun 2017 13:20:03 +0300
parents
children 93fb6c09f2e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
1 define(["dojo/_base/declare", "dojo/_base/array", "core/safe", "./StoreAdapter"], function(declare, array, safe ,AdapterStore){
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
2 return declare([AdapterStore], {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
3 _attrs : null,
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
4
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
5 constructor : function(opts) {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
6 safe.argumentNotEmptyArray(opts.attrs, "opts.attrs");
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
7 this._attrs = opts.attrs;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
8 },
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
9
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
10 mapItem : function(item) {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
11 var result = {};
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
12 array.forEach(this._attrs, function(p) {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
13 result[p] = item.get(p);
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
14 });
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
15 return result;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
16 }
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
17 });
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
18
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
19 });