I've created a dynamic table and now I'm trying to extract the data from it and store it in a multidimensional array. However, I keep encountering an exception/error that says "Cannot set property of 0 to undefined". https://i.sstatic.net/W8B9j.png
Here's my JS Function:
var DefAttrArray = new Array(100);
function storeDefinedStreamInfo(newAgent,i,e,ui)
{
var StrName= document.getElementById("StreamNameInput").value;
var StreamElementID = i;
var table = document.getElementById('attrtable');
var tblerows = (table.rows.length)-1;
for (r = 1; r < table.rows.length; r++) {
for(var c=0; c<1;c++) {
var attrNm = table.rows[r].cells[c].innerHTML;
var attrTp = table.rows[r].cells[1].innerHTML;
createdDefinedStreamArray[i-1][2][r-1]= new Array(2);
createdDefinedStreamArray[i-1][2][r-1][0]=attrNm;
createdDefinedStreamArray[i-1][2][r-1][1]=attrTp;
alert(createdDefinedStreamArray[i-1][2][r-1][0] + "\n" + createdDefinedStreamArray[i-1][2][r-1][1]);
}
}
createdDefinedStreamArray[i-1][0]=StreamElementID;
createdDefinedStreamArray[i-1][1]=StrName;
createdDefinedStreamArray[i-1][2]=new Array(tblerows);
createdDefinedStreamArray[i-1][3]="Defined Stream";
alert("createdDefinedStreamArray[i-1][2][w][0] : "+ createdDefinedStreamArray[i-1][2][w][0]);
var prop = $('<a class="streamproperty" onclick="doclickExp(this)"><b><img src="../Images/settings.png"></b></a> ').attr('id', (i));
var showIcon = $('<img src="../Images/Defined.png"></b></a> ').attr('id', (i));
newAgent.text(StrName).append('<a class="boxclose" id="boxclose"><b><img src="../Images/Cancel.png"></b></a> ').append(showIcon).append(prop);
dropCompleteElement(newAgent,e,ui);
}