Results Library Modifications:
Require a list of topics to change with the result type change
Online query data start, in the Result type dropdown box add change () event trigger DWR, Query topic Collection--Create/Edit table dynamically
The outline code is as follows:
Js
Copy Code code as follows:
Dynamically get Topic data
function Getzts () {
ParentID = document.getElementById ("Bselect1"). Value;
if (parentid!= "") {
Dwrmethod.getztlist (PARENTID,CALLBACK5);
}else{
Clear the data for the topic 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 is a row, empty
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 is a row, empty
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
Copy Code code as follows:
<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" > Theme </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>