function myfunction() {
var list = $("#dataGrid").datagrid("getRows");
var strs = "{\"employ\":[";
for (var i = 0; i < list.length; i++) {
strs += "{\"itemid\":\"" + list[i].itemid + "\"}";
}
strs += "]}";
alert(strs);
}
最终解答:
JSON.stringify($('#dg').datagrid('getData')));
返回的结果为Json串