Search code examples
javascriptarraysjsonhandsontable

I have created a Handsontable and want to render Json Data?


I have created a handsontable and getting a ajax request from local json file and when i tried to render both rows are showing same values,

[object, object] currently getting json response in this way a array of two objects.

when i render on Handsontable getting like this example:

name | phone ... 
test | 123123
test | 123123

I'm new to Javascript any help would be aapriciated.

enter image description here


Solution

  • JSON data :

    var data.result = [ 
       {"Id": 10004, "PageName": "club"}, 
       {"Id": 10040, "PageName": "qaz"}, 
       {"Id": 10059, "PageName": "jjjjjjj"}
       ];
    

    Get this data in jQuery:

    $.each(data.result, function(i, item) {
        alert(data.result[i].PageName);
    });