diff --git a/src/jio.storage/indexeddbstorage.js b/src/jio.storage/indexeddbstorage.js index 69c1f2ceea0039270519f100dc4489ba402d4d82..1604d30ced33ce6a6cd2990506367a6c073227e8 100644 --- a/src/jio.storage/indexeddbstorage.js +++ b/src/jio.storage/indexeddbstorage.js @@ -385,7 +385,7 @@ index_req = index.openCursor(); date = Date.now(); index_req.onsuccess = function (event) { - var cursor = event.target.result, now; + var cursor = event.target.result, now, value, i, key; if (cursor) { // Called for each matching record. @@ -420,17 +420,26 @@ } } + value = {}; + // option.select_list management + if (option.select_list) { + for (i = 0; i < option.select_list.length; i += 1) { + key = option.select_list[i]; + value[key] = cursor.value[key]; + } + } + // option.include_docs management if (option.include_docs) { rows.push({ "id": cursor.value._id, "doc": cursor.value, - "value": {} + "value": value }); } else { rows.push({ "id": cursor.value._id, - "value": {} + "value": value }); }