上面菜单展开了,下面的没有下移,重了!
IE9 EXTASP.NET 3.1.3
前台代码:
<ext:Region ID="regionLeft" Split="true" Width="200px" Margins="0 0 0 0" ShowHeader="true"
Title="导航菜单" Icon="Outline" EnableCollapse="true" Layout="Fit" Position="Left"
runat="server">
<Items>
<ext:Accordion ID="AccordionmMenu" runat="server" ShowBorder="false" ShowHeader="false"
ShowCollapseTool="true" />
</Items>
</ext:Region>
后台代码:
string strMenuSql2 = @"select funcid,funcname,treeid,nvl(runwhat,'#') runwhat
from sys_function
where treeid='@treeid'
and (instr('@ROLELIST','00',1)>0 or funcid in (select funcid from sys_rolefunc where instr('@ROLELIST',ROLEID,1)>0) )
order by itemsort ";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
InitMenu();
btnUser.Text = UserAction.LoginName;
}
}
private void InitMenu()
{
DataTable dtMenu = DbHelperOra.Query(strMenuSql2.Replace("@treeid","1").Replace("@ROLELIST", UserAction.LoginRole)).Tables[0];
int i = 0;
foreach (DataRow dr in dtMenu.Rows)
{
ExtAspNet.AccordionPane panel = new ExtAspNet.AccordionPane();
AccordionmMenu.Items.Add(panel);
panel.Title = dr["funcname"].ToString();
panel.ShowBorder = false;
panel.IconUrl = "~/images/16/" + (i ++ ).ToString() + ".png";
ExtAspNet.Tree tree = new ExtAspNet.Tree();
tree.ShowBorder = false;
tree.ShowHeader = false;
tree.AutoScroll = true;
tree.EnableArrows = true;
tree.CssStyle = "font-family:仿宋体;font-size:18px; margin-top: 5px;";
tree.CssClass = "mainmenu";
tree.Height = new Unit(500);
//tree.AnchorValue = "100%";
MenuSubGet(tree.Nodes,dr);
panel.Items.Add(tree);
}
}
private void MenuSubGet(ExtAspNet.TreeNodeCollection TreeNodes, DataRow Menu)
{
string MenuSqlSub = strMenuSql2.Replace("@treeid", Menu["funcid"].ToString()).Replace("@ROLELIST", UserAction.LoginRole);//MenuSqlSub
DataTable dtMenu = DbHelperOra.Query(MenuSqlSub).Tables[0];
foreach (DataRow dr in dtMenu.Rows )
{
ExtAspNet.TreeNode node = new ExtAspNet.TreeNode();
node.Text = dr["funcname"].ToString();
node.NodeID = dr["funcid"].ToString();
node.Target = "mainRegion";
if (dr["runwhat"].ToString() == "#")
{
MenuSubGet(node.Nodes,dr);
}
else
{
node.Leaf = true;
node.NavigateUrl = dr["runwhat"].ToString();
node.IconUrl = "images/collapse-all.gif";
}
TreeNodes.Add(node);
}
}
|