jqgrid has no method ‘addJSONData’

Working with jqGrid, placing a Json response as data source, trying to do this stuff according to jqGrid documentation gave me:

gridPlayers.addJSONData(jsonStr );

But I was left stranded with this message:

[mygrid] ...has no method 'addJSONData'

Using this post: http://stackoverflow.com/questions/545714/jqgrid-addjsondata-asp-net-2-0-ws I realized that the data source is actually an array and some kind of wrapping is needed for the Json data so:

var jsonObject = eval('(' + jsonStr + ')');

works 🙂

One thought on “jqgrid has no method ‘addJSONData’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s