Results Library Modifications:
Request a list of topics to change with the outcome type
Start on the web, add the change () event trigger DWR in the result type dropdown box, query theme collection--Create/Edit table dynamically
The summary code is as follows:
JSP page
[JavaScript]
Get Topic Data Dynamically
function Getzts () {
ParentID = document.getElementById ("Bselect1"). Value;
if (parentid!= "") {
Dwrmethod.getztlist (PARENTID,CALLBACK5);
}else{
Empty the data for the subject table
var T=document.getelementbyid ("Zhutitable"); Get table
var length= t.rows.length; Get the number of rows under table
if (length!=0) {//If there are lines, clear
for (Var i=length-1;i>=0;i--)
{
T.deleterow (i);
}
}
var r = T.insertrow ();
var c = R.insertcell ();
C.innerhtml= "no topic list";
document.getElementById (' zhutitable '). appendchild (t);
}
}
function Callback5 (provinces) {
var T=document.getelementbyid ("Zhutitable"); Get table
var length= t.rows.length; Get the number of rows under table
if (length!=0) {//If there are lines, clear
for (Var i=length-1;i>=0;i--)
{
T.deleterow (i);
}
}
if (provinces.length>0) {
for (var i = 0; i < provinces.length; i++) {
Tr
if (i%4==0) {
var r = T.insertrow (t.rows.length);//Create a new row
}
Td
var c = R.insertcell (); Create a new column
c.innerhtml = "<input type= ' checkbox ' name= ' zhutiids ' value=" +provinces[i][0]+ ">" +provinces[i][1 ";
}
}else{
var r = T.insertrow ();
var c = R.insertcell ();
C.innerhtml= "no topic list";
}
document.getElementById (' zhutitable '). appendchild (t);
}
[HTML]
<tr>
<TD class= "Add_tit" > Achievement type </td>
<td>
<s:select id= "Bselect1" name= "PruType1" onchange= "Getzts ();" List= "Ptypelist" listkey= "id" listvalue= "productiontypename" headerkey= "" headervalue= "--Please select--"/>
<label class= "Note4" >*</label>
</td>
</tr>
[HTML]
<tr>
<TD class= "Add_tit" > Themes </td>
<TD id= "table1" style= "padding-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;" >
<table id= "zhutitable" border= "0" cellpadding= "0" cellspacing= "0" width=100% class= "table_table" >
<tr>
<TD style= "color:red;" > Note: Please select the result type first </td>
</tr>
</table>
</td>
</tr>
---------------------------------------------------------------------------------------------I'm a split line----------------------- ------------------------------------------------------------------------------------
function Tbheartrates () {$.post (window.location.href, {"Action":"tbheartrates"}, Function (msg) {if(msg! ="") {alert ("1"); varobj = eval ("("+ msg +")"); varnum =obj.rows.length; //var aa = document.getElementById (' tbheartrates ');$('#tbheartrates'). Append ('<tr><th> test Date </th><th> test results </th><th> normal range </th> <th> unit </th ><th> Warm Tips </th><th></th><th></th><th></th><th></th ></tr>'); for(vari =0; i < num; i++) { varTROBJS = Document.createelement ("TR"); Trobjs.innerhtml='<td class= "Tdfirstline" >11 month 10th </td> <td class= "Tdsecondline" >'+ Obj.rows[i]. JSON_ECG +'</td> <td class= "Tdthreeline" >60-100</td> <td class= "Tdfourline" > Times/m</td> <TD class= "Tdfiveline" > Your heart rate is below normal range </td> <td class= "Tdsixline" ></td> <td class= "Tdsevenline" > </td> <td class= "Tdeightline" ></td> <td class= "Tdnineline" ></td>'; varTrobjimg = Document.createelement ("TR"); Trobjimg.innerhtml='<td colspan= "9" >'+ Obj.rows[i]. Json_ecgxy +'" style=" margin-left:-30px; "/></td>'; $('#tbheartrates'). Append (TROBJS); $('#tbheartrates'). Append (trobjimg); } } }); }
JS dynamic Add table Data tr TD