Hi, I'm using Dgrid to display Query Results. I want to dynamic add feature data to store. Here is two code paragraphs:
First Code:
var typesData = [];
for (var i = 0; i < 5; i++) {
var j ={
objectid: results.features.attributes.objectid,
madvhc: results.features.attributes.madvhc,
ten: results.features.attributes.ten,
tinh: results.features.attributes.tinh,
diachi: results.features.attributes.diachi,
macosoyte: results.features.attributes.macosoyte,
macsyt1: results.features.attributes.macsyt1,
loaihinhcsyt: results.features.attributes.loaihinhcsyt,
huyen: results.features.attributes.huyen,
matinh: results.features.attributes.humatinhyen,
mahuyen: results.features.attributes.mahuyen,
tuyencsyt: results.features.attributes.tuyencsyt,
kinhdo: results.features.attributes.kinhdo,
vido: results.features.attributes.vido,
xaphuong: results.features.attributes.xaphuong,
filegoc: results.features.attributes.filegoc,
namdieutra: results.features.attributes.namdieutra
};
typesData.push(j);
}Second Code:
var typesData = [];
for (var i = 0; i < 5; i++) {
typesData.push(results.features.attributes);
}The first and the second have the same number of fields but the first can display with right row value in grid when selected, the second only get the last row value in grid when selected. I cannot find what is a problem. Please help me.