javascript - How to iterate json object string? -
my jsonresult follows
[{"name":"group 1"},{"name":"group 2"},{"name":"group 3"}] i'm little bit confused while writing loop, how iterate on or values of name inside buildselect function in editoptions in jqgrid? colmodel code in jqgrid follows
{ name: 'groupname', index: 'groupname', width: 60, align: 'center', search: false, editable: true, edittype: 'select', editoptions: { dataurl: "/category/getcategorygroup", buildselect: function (response) { if (response && response.length) { // loop iteration name values } } } },
var groups = [{"name":"group 1"},{"name":"group 2"},{"name":"group 3"}]; for(var = 0; i< groups.length; i++) { var name = groups[i].name; }
Comments
Post a Comment