好吧,我創建了我的IndexedDB,在創建期間使用'store.put'創建了一些數據。 我然後關閉連接並重新打開的連接,以使用遊標到所述數據推送到WinJS綁定列表:WinJS Binding LIst中的IndexedDB「undefined」
var myData = new WinJS.Binding.List();
myData.push(cursorp.value);
現在,當I 「的console.log(MYDATA的);」我得到這個:
[object Object]
myDataStore.js (70,21)
{
[functions]: ,
__proto__: { },
_binding: undefined,
_currentKey: 1,
_keyMap: {
[functions]: ,
1: {
[functions]: ,
__proto__: { },
data: {
[functions]: ,
__proto__: { },
theDay: "F",
id: 1,
listItemN: "My Note.",
day: "1/10/2016"
},
handle: "1",
key: "1"
},
__proto__: { }
},
_keys: [ ],
_lastNotifyLength: 1,
_listeners: null,
_modifyingData: 0,
_notifyId: 0,
_pendingNotifications: null,
_proxy: undefined,
dataSource: { },
length: 1,
onitemchanged: undefined,
oniteminserted: undefined,
onitemmoved: undefined,
onitemmutated: undefined,
onitemremoved: undefined,
onreload: undefined
}
當我嘗試做一個ListView我得到的名單元素與「不確定」它裏面。我已經改變了它,使我得到,我想這一切三個項目:
myData.push(cursorp.value.listItemN, cursorp.value.theDay, cursorp.value.day);
但它做同樣的事情,每個元素都有「不確定」它裏面。
我只是沒有看到如何從這個綁定列表中拉出數據。
這是我創建的模板。它通過一個命名空間會從另一個js文件的數據的價值:
var myListDataInfo = myOwnNamespce.itemList;
var myTemp = (function myTemplate(myPromise) {
return myPromise.then(function(listNote) {
var div = document.createElement("div");
div.className = "myListContainer";
var myListNote = document.createElement("h4");
myListNote.innerText = listNote.myListDataInfo;
div.appendChild(myListNote);
return div;
})
});
任何幫助,將不勝感激。 -Rob0
我想說是綠色/新節目的某些方面導致了這些問題。我瀏覽了代碼,發現問題最可能出現的地方。有時間研究JavaScript的異步編程。我稍後再添加。 – Rob0today