Suppose you have the following style sheet structure
In the tabulation, take the hands-on steps to teach you to write tables in the SPRINGMVC without frames, as shown below
function Refreshtable (OBJS) {
$ ("#ObjTables"). HTML ("");
For (i in OBJS) {
if (objs[i].obj_type!= "FRAME") {
$ ("#ObjTables"). Append ("<tr><td>" +objs[i].obj _id+
"</td><td>" +objs[i].obj_name+ "
</td><td>" +objs[i].ziduan_name+ "
</ Td><td> "+objs[i].obj_type+" ("
</td><tr>");
} else{
$ ("#ObjTables"). Append ("<tr><td>" +objs[i].obj_id+
"</td><td>" +objs[i]. obj_name+
"</td><td>" +objs[i].ziduan_name+ "
</td><td id= ' >" +objs[i].obj_ type+ "<button onclick=" getframecontent (This) ' data-toggle= ' modal ' data-target= ' #myModal ' >+</button> ' +
"</td><tr>");
}
}
;
Unlike the blog written before, it is here, through the objs of the Obj_type, a differentiated tabulation, and then, for Type frame row, add button option to show more tables, that table has tables, this feature has the opportunity to introduce
noticed that
When you click this button, the method is called
function Getframecontent (frameselect) {
//get a clicked line of tr var tr = $ (frameselect). Parent (). parent ();
Gets all TD element
var B = A.children ("TD") of TR;
Get the third column element
var c = B.eq (2);
Displays the value of the third column
var d= c.text ();
alert (d);
}
Here function inside in order to demonstrate, did not do the concrete operation, is obtains through these several statements to hit one row third column The value, the other column is same.
If you want to get other rows (which are rarely the case), you need to be in the first sentence
var tr = $ (frameselect). Parent (). Parent (). parent ();
Get to the table element, or directly with $ ("#XXX"), but that's not directly related to a specific button we clicked.
Finally, the page popup effect
It worked.
The above is a small series for you to bring JQ through TD to get peer other listed TD's method all content, I hope we support cloud-Habitat Community ~