I need to implement DataTable struct ,that is in c#, in javascript. For example
function Servers(name)
{
this.Name = name;
this.Columns = new Array(5);
var rows = new Array(3);
for (var i=0;i<3;i++)
rows[i]=new Array(5);
this.Rows = rows;
}
I simply access jth element of ith Row by typing like this;
Servers.Rows[i][j]
This works good, but I need to call my object like this;
Servers.Rows[i]["ServerUrl"]
But I dont know how to implement a prototype for this work. Is there anyway to achieve this?
Note: Columns array holds Column names like in c# and Columns array size always equals to Rows' sub array.
rows[i]={};