0

I have tried to build a datatable using the datatables plugin.

Following are screen shots of the response I am getting using ajax in Firefox. For some reason I am not able to bind the data with the datatable in second scenario. The JSON object seems to be loading fine.

I have seen that in the first case I am sending back a list of Objects to the aaData variable for datatables and this works with the datatable. However in the second case where its not working, I am sending back the data in the form of string arrays in the json response for aaData. I cant send a list of java objects as I am not sure how many columns the table will have. It can have dynamic number of columns.

![Working Scenario][1]

![enter image description here][2]

I want to know what is going wrong in the second screen shot and why aaData is not accepting array objects?

1
  • Sorry images can be opened in a new tab. I am not sure why they appear to be so small on there. I am new to the site. many thanks! Commented Jan 9, 2015 at 18:46

1 Answer 1

0

I solved it by parsing the data using: var json = JSON.parse(data);

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

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.