Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
402 views
in Technique[技术] by (71.8m points)

javascript - Populate JQuery DataTable with my json data

I'm suggested to use JQuery data table. Now I need to populate grid with bunch of json objects sent from my controller. How can I send this data on the grid from js

$.ajax({
            ...
            url: '/Home/ReturnJsonData',
            success: function (result) {
                $.each(result, function (i, item) {
                    // this is where I should sent item object to my grid
                });
            },

            error: function () { alert("error"); }
        });

Update I've found these link, but I dont know how to implement it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use Jquery Grid Plugin in that case.

Read this article to use MVC Data Grid: using jqGrid and JSON

http://blog.davidrenz.com/?p=663

Update:

In that case if you only want to use J-query Datatable go to this link.

http://www.codeproject.com/Articles/155422/jQuery-DataTables-and-ASP-NET-MVC-Integration-Part


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...