0
基於this答案,我想將存儲數據轉換爲對象並定義鍵值。這裏是我相關的代碼:將存儲數據轉換爲包含已定義鍵名的對象ExtJS
var recordArray = {};
var paramArray = [];
store.each(function(record){
recordArray.comment = record.get("comment");
recordArray.datecreated = record.get("datecreated");
paramArray.push(recordArray);
});
console.log(Ext.encode(paramArray));
但是從商店打印出來只有最後的數據,與和數據之和相匹配。假設我有一個像這樣從列表視圖數據:
[{comment: a, datecreated:1-2-1999}, {comment: b, datecreated:2-2-1999}]
打印出來:
[{comment: b, datecreated:2-2-1999}, {comment: b, datecreated:2-2-1999}]
我想要什麼,當然,使用ParamArray包含的ListView的每個對象,不只是同一個。有任何想法嗎?幫助讚賞。