Commit c0aa7a7f authored by Tristan Cavelier's avatar Tristan Cavelier

add select_list option management

parent b3a6839e
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
index_req = index.openCursor(); index_req = index.openCursor();
date = Date.now(); date = Date.now();
index_req.onsuccess = function (event) { index_req.onsuccess = function (event) {
var cursor = event.target.result, now; var cursor = event.target.result, now, value, i, key;
if (cursor) { if (cursor) {
// Called for each matching record. // Called for each matching record.
...@@ -420,17 +420,26 @@ ...@@ -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 // option.include_docs management
if (option.include_docs) { if (option.include_docs) {
rows.push({ rows.push({
"id": cursor.value._id, "id": cursor.value._id,
"doc": cursor.value, "doc": cursor.value,
"value": {} "value": value
}); });
} else { } else {
rows.push({ rows.push({
"id": cursor.value._id, "id": cursor.value._id,
"value": {} "value": value
}); });
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment