(NewBie) Populating DataTable.

(NewBie) Populating DataTable.

gunjanthesystemgunjanthesystem Posts: 1Questions: 1Answers: 0

Hi,

I need to populate DataTable on a JSP page with the json text returned from a servlet. An Ajax call (POST) is made to the servlet with two parameters. My ajax call will be something like:

jQuery.ajax(
                        {
                            url: "XServlet",
                            cache: false,
                            data: {StringPost1 : String1, StringPost2: String2},
                            type: 'POST',
                            dataType:"text",
                            success: function(jsonTextResponse)
                            {...}

                           });

Please tell me how to use the returned json 'jsonTextResponse' to populate the table.
Also the number of columns in the table depends on the json text.

Kindly help. I saw the examples in documentation but I am not able to make it work.

Thanks

This discussion has been closed.