0

representation of my json data from arraList

var data = [{"analystNo":"","batch_name":"","can":"","curator":"kandasamy",
  "curator_status":"Available","current_login":"","qc":"",
  "qc_status":"","role":"","tan":"17264639U","worker":""},{"analystNo":"","batch_name":"","can":"","curator":"bramma",
 "curator_status":"Available","current_login":"","qc":"",
 "qc_status":"","role":"","tan":"17580309X","worker":""},{"analystNo":"","batch_name":"","can":"","curator":"abc",
 "curator_status":"Available","current_login":"","qc":"abc",
 "qc_status":"Available","role":"","tan":"17671633K","worker":""}]

jquery

var insert="";

for(var i=0;i<data.length;i++){
    insert += "<tr><td>"+data[i].tan+"</td><td>"+data[i].curator+"</td><td>"+data[i].curator_status+"</td><td>"+data[i].qc+"</td><td>"+data[i].qc_status+"</td></tr>" ;
}
alert(insert);
$('#tableID').append(insert);

inside html body

<table id='tableID' border="2">
<table>

i tested this here but not working. i think i miss something some where.

1
  • 7
    Change framework to jQuery on the left Commented Feb 22, 2012 at 12:30

1 Answer 1

3

change the framework dropdown on the left pane from mootools to jquery 1.7.1.

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

5 Comments

I would like to have a check box in each row at the 1st column which has the value of the existing 1st column. so i can send this as a struts2 form submit. how to do this?
add this in insert string after tr <td><input type='checkbox' name='checkbox' value='"+data[i].tan+"' /></td>
its working and here I got another problem. json1=new JSONArray(); json1.addAll(allocationList); this is how I have created JSON. but I was unable to get it in my jquery success part why? and it goes to error part. my action class is returning success only.
and this is the jquery I have used to read json link
Problem Solved!!! I used struts2-json-plugin, with some edition in struts.xml and so I dont need to convert any thng to json.

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.