I’ve spent a long time trying to work this out, but no success thus far. Basically, there will be a JSON dataset coming via a jQuery GET or similar, which will differ in the number of columns and column names. Datatypes will vary. One time it may be Name=Bob, Age=50 (etc) while next time it may be name, address, and occupation.
All I’d like to do is present that in a grid in my MVC view, which ideally provides some paging/sorting etc. Column names should be derived from the labels in the JSON. I’m happy to pay for such a component if needed.
That’s it! If I fail I guess I’ll just have to render HTML and do without the other features.
Thanks
PS. The actual data will come from anonymous collections, generated by LINQ queries in the controller. Binding to such a type would be the perfect solution if anyone knows how (on demand paging would be great) but no luck yet. 2 Days of getting the Telerik MVC grid to bind to an anonymous type or any conversion of it (dynamics, tables, etc) has been unsuccessful so far. I’ve added telerik MVC and Jqgrid as tags in case there are gurus monitoring those sections who know the answer.
You might want to look at the DataTables jQuery plug-in. It has built in paging, sorting and a lot of other cool features. Most of the examples show rendering the entire table on the page and then it takes over with the paging, etc. It does however, also support the use of server side binding and here is a good example of that binding within a ASP.NET MVC site – jQuery DataTables and ASP.NET MVC Integration.
I have been using this plug-in for about a month now and have been very happy with it so far.