Modify the fruit Database: the topic list is required to change the online data query mode as the result type changes. In the results type drop-down box, add the change () event to trigger Dwr and query the topic set & mdash; the summary code of dynamic Table creation/editing is as follows: Jsp page [javascript] // dynamic topic data acquisition... modify the SyntaxHighlig fruit database:
The topic list must change with the result type.
After you query data on the Internet, start the operation. In the result type drop-down box, add the change () event to trigger Dwr and query the topic set-dynamically create/edit a Table.
The Code is as follows:
Jsp page
[Javascript]
// Obtain topic data dynamically
Function getzts (){
ParentId = document. getElementById ("bselect1"). value;
If (parentId! = ""){
DwrMethod. getZtList (parentId, callback5 );
} Else {
// Clear the data of the topic Table
Var t = document. getElementById ("zhutiTable"); // get Table
Var length = t. rows. length; // obtain the number of rows in the Table.
If (length! = 0) {// clear if there are rows
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; // obtain the number of rows in the Table.
If (length! = 0) {// clear if there are rows
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 =" "+ Provinces [I] [1];
}
} Else {
Var r = t. insertRow ();
Var c = r. insertCell ();
C. innerHTML = "No topic list ";
}
Document. getElementById ('zhutitable'). appendChild (t );
}
[Html]
Result type
*
[Html]
Topic
Note: select the result type first. |
From the day of that year and month