I have below code that get values from a grid. Instead of printing the values, the grid is printing data in below object format. How to print values?
[object Object], [object Object], [object Object], [object Object], [object Object]
CODE:
$(document).ready(function () { $("#check").click(function(){ var rows = $('#jqxgrid').jqxGrid('getrows'); alert(rows); }); });
A simple way is to use
JSON.stringify(rows)
i.e.
alert(JSON.stringify(rows))
Else, you would need to manually traverse the object's properties and print them accordingly. Give more details about input and desired output for an example.
An example in interactive Node.js:
> x = { 1: 2, 3:4 }; { '1': 2, '3': 4 } > x.toString(); '[object Object]' > JSON.stringify(x) '{"1":2,"3":4}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With