ingrid0.9.9目前並不支持設定列的個數,默認爲是4列,這樣如果你返回的表格數據不是4列的話,就會報錯。
查看ingrid源碼,可發現colWidths:[225,225,225,225],說明默認的情況下會執行這句話,這就間接的規定了列數爲4.所以如果要修改列數的話,在啓動時候加入參數colWidths就好了。
如:
$("#fileListTable").ingrid({
url : 'changeMultiFiles.action',
height : 350,
colWidths : [ 100, 200, 200, 200, 200, 100 ],
recordsPerPage : recordsPerPageValue,
totalRecords : totalRecordsValue
});