How to get key and value from a js map
<p>I am trying to write a custom grid in jquery so took a look at jquery plugin development. In it I assigned headers for the grid and want to assign rows, but need help with assigning values to rows.</p>

<pre><code>var headers=new Array();
headers=["Name","Host Name","Description","Type","Last Update Time"];
</code></pre>

<p>I thought of creating a array of maps like below, which will get assigned as rows in my grid, but need help in understanding how to assign. Similar to <code>headers</code> these rows can be generic.</p>

<pre><code>var myrows = [
                {cfgid:0, name:"Lukas Arts",host:"baxton", description:"test",type:"Dev",updateDate:"Thu Apr 26 04:31:10 IST 2012"},
                {cfgid:1, name:"Adiga",host:"beetle", description:"test",type:"Dev",updateDate:"Fri Apr 27 07:21:43 IST 2012"},
                {cfgid:2, name:"Max Miller",host:"barry", description:"test",type:"Dev",updateDate:"Mon Apr 16 04:11:40 IST 2012"}
                ];
</code></pre>

<p>This is the code</p>

<pre><code>jQuery.fn.abcGrid = function (tableid, heading, data, options) {
    abcoptions = jQuery.extend ({
    tableCss: "tableForms",
    tableHeaderCss: "tableHeading",
    label: "Informatica CSM",
    header: heading,
    rows: data
    }, options);

    var ele_table='';
    var ele_table_start='&lt;table id="'+abcoptions.tableid+'" class="'+abcoptions.tableCss+'"&gt;&lt;tbody&gt;';
    var ele_table_end='&lt;/tbody&gt;&lt;/table&gt;';
    var ele_table_header='';
    var ele_table_row='';

    var tempHeader='';
    var tempRow='';

    /*Table header creation*/
    for(var i=0;i&lt;abcoptions.header.length;i++)
        tempHeader+='&lt;td class="'+abcoptions.tableHeaderCss+'"&gt;'+abcoptions.header[i]+'&lt;/th&gt;';
    ele_table_header='&lt;tr&gt;'+tempHeader+'&lt;/tr&gt;';

    ele_table=ele_table_start+ele_table_header+ele_table_end;
    $(this).html(ele_table);
    //it creates only headers properly
};
</code></pre>

<p>I call this code as </p>

<pre><code>$('#updateDiv').abcGrid("tabel1", headers, myrows);
</code></pre>
