我一直在研究如何使用jQuery動態構建網格。我已經閱讀了大量的API,並通過s.o進行了搜索。和谷歌,但似乎沒有人給它一個明確的整體立場。也許我只是不明白,所以我使用了一個名爲構建表的函數,我想返回結果。動態地使用jquery構建網格
所以一旦這個生成表按鈕被點擊,那麼它應該顯示網格。
但是沒有顯示
任何一個可以幫助
function buildTable(criteria)
{
var result = new Object();
result.rows = criteria.rows;
result.totalRows = result.rows + 1;
result.row = new Array();
for(var i = 0; i < result.rows; i++)
{
result.row[i] = new Object();
result.row[i].shoeId = 100+i;
result.row[i].dressId = "LKM0" + i;
result.row[i].arrivalDt = "01/02/2013 15:45";
result.row[i].stockDt = "01/02/2013 15:46";
result.row[i].fashionStatus = "differences";
}
return result;
}
</script>
<input type="button" value="Generate a table." onclick=" document.getElementById('Grid').style.visibility = 'visible';" />
<div class="Grid" id="Grid" onload="buildTable()" > </div>
建立表您是在客戶端還是服務器端生成數據? –
我從服務器端生成數據db – bigsteve4288