I'm trying to use slickgrid to render a very simple table and the result is unexpected. Here is the code:
<script>
var grid;
var columns = [
{id:"id", name:"ID", field:"id"},
{id:"a", name:"A", field:"a"},
{id:"b", name:"B", field:"b"}
];
var options = {
enableCellNavigation: false,
enableColumnReorder: false
};
$(function() {
var data = [];
data[0] = {
id: "1",
a: "1",
b: "1" };
data[1] = {
id: "2",
a: "2",
b: "2" };
grid = new Slick.Grid("#myGrid", data, columns, options);
$("#myGrid").show();
});
</script>
Instead of displaying:
| ID | A | B |
| 1 | 1 | 1 |
| 2 | 2 | 2 |
I got
| ID | A | B |
| 1 | 1 |
| 2 | 2 |
| 2 |
Could somebody tell me how this could happen?
Thanks