Bootgrid append method -
im breaking head , cant figure out how append data, testing pourpuses did :
var jsoninfo = {"rows": [{"id": 19, "sender": "123@test.de", "received": "2014-05-30t22:15:00", "status":"garantia"},{"id": 19, "sender": "123@test.de", "received": "2014-05-30t22:15:00", "status":"garantia"} ]}; var result = []; for(var in jsoninfo) result.push([i, jsoninfo [i]]); $("#grid-basic").bootgrid().bootgrid("append",result.rows);
but cannot insert data in table ... can clarify format array should have ?, or more comprehensive example? ... lot !
i had same problem grid. problem was loading grid ajax.
removing the ajax: true
and/or setting default false
solved "append", "remove" , "clear" problem had solve loading problem.
in case, decided not using grid "append" function , reload grid data server side call. $("#mygrid").bootgrid('reload')
i not happy solution @ least found problem had
var grid = $("#mygrid").bootgrid({ ajax: false, formatters: { "commands": function (column, row) { return "<button type=\"button\" class=\"btn btn-xs btn-default command-edit\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-pencil\"></span></button> " + "<button type=\"button\" class=\"btn btn-xs btn-default command-delete\" data-row-id=\"" + row.id + "\"><span class=\"fa fa-trash-o\"></span></button>"; } } })
Comments
Post a Comment