0

Can anyone point me in the right direction?

I'm looking to use DataTables.net or jqGrid with an ASP MVC4 ApiController action for the source.

The problem I have is that i just return an array of objects.. e.g. [{"Name":"Brian", "Age" : "35"}, {"Name":"Jim", "Age" : "45"}]

I don't format it like the samples i.e. with aaData or arrays of string. Can anyone tell me how they overcome this problem?

I'll even settle for jqGrid if someone and point me in the direction of a good example. tnx Brian.

2 Answers 2

2

It' not a problem in jqGrid. You need just define jsonReader which describe how the data can be read by jqGrid. For example

See the demo:

enter image description here

It uses

jsonReader: {
    repeatitems: false,
    id: "Name",
    root:  function (obj) {
        return obj;
    }
}

and the JSON data which you posted.

Sign up to request clarification or add additional context in comments.

Comments

0

To use different actions(Post, Put and Delete) of ASP.NET Web API for add edit delete operations, check following example: http://techbrij.com/1017/add-edit-delete-jqgrid-asp-net-web-api

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.