private void ShowZone()
{
DataBase db = new DataBase();
DataSet ds = new DataSet();
ds = db.GetDataSet("select root_id ,zone_id ,Depth ,zone_name,zone_code ,parent_id from tbZones where company_id =" + Convert.ToString(this.companyId)
+ " order by left(zone_code,3) asc , zone_code asc");
int level = 0;
Response.Write("<ul>");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
if ((int)ds.Tables[0].Rows[i].ItemArray[2] < level)
{
for (int j = 0; j < level - 1; j++)
{
Response.Write(" </ul>");
}
}
if ((int)ds.Tables[0].Rows[i].ItemArray[2] > level)
{
Response.Write(" <ul>");
}
Response.Write("<li><input type='radio' name='treeView' id=" + ds.Tables[0].Rows[i].ItemArray[1] + "> <label for=" + ds.Tables[0].Rows[i].ItemArray[1] + ">" + ds.Tables[0].Rows[i].ItemArray[3] + "</label></li>");
level = (int)ds.Tables[0].Rows[i].ItemArray[2];
}
Response.Write("</ul>");
}
树,怎么实现伸展和收缩