<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Window ID="UploadWindow" IDMode="Client" runat="server" Width="550" AutoHeight="true"
Title="Upload a File">
<Items>
<ext:Panel ID="Panel1" runat="server" LabelWidth="200" ButtonAlign="Left" Padding="10" Layout="FormLayout">
<Items>
<ext:FileUploadField ID="FileUploadField1" runat="server" FieldLabel="Please browse a file to upload"
ButtonOnly="false" Width="300" />
<ext:TreePanel ID="FolderTree" runat="server" Height="200" UseArrows="true" FieldLabel="Please select a directory"
AutoScroll="true" Animate="true" EnableDD="true" ContainerScroll="true" RootVisible="false">
</ext:TreePanel>
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Upload" />
</Buttons>
</ext:Panel>
</Items>
</ext:Window>
Привет, все работает нормально и нормально, кроме «ВЫБРАННОГО УЗЛА НЕ ВЫДЕЛЕНО» от щелчка мыши (один или два щелчка) и навигации по клавиатуре.
РЕДАКТИРОВАТЬ
Код для заполнения триода:
protected void Page_Load(object sender, EventArgs e)
{
Ext.Net.TreeNode root = this.CreateNode(SiteMap.RootNode);
root.Draggable = false;
root.Expanded = true;
FolderTree.Root.Add(root);
FolderTree.ExpandAll();
}
/// <summary>
/// Creates nodes from sitemap data
/// </summary>
/// <param name="siteMapNode">Pass the root node of Web.sitemap</param>
/// <returns></returns>
private Ext.Net.TreeNode CreateNode(SiteMapNode siteMapNode)
{
Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode();
treeNode.NodeID = siteMapNode.Key;
treeNode.Text = siteMapNode.Title;
treeNode.Qtip = siteMapNode.Description;
//treeNode.Href = siteMapNode.Url;
treeNode.Icon = this.GetIcon(siteMapNode["menuId"].ToString(new CultureInfo("en-Us")));
string iconCls = GetIconCls(treeNode.Icon);
//System.Windows.Forms.MessageBox.Show(iconCls);
treeNode.Listeners.Click.Handler = string.Format(new CultureInfo("en-US"), "#{{MainPanel}}.load('{0}');#{{MainPanel}}.setIconClass('{1}');#{{MainPanel}}.setTitle('{2}');", siteMapNode.Url, iconCls, siteMapNode.Title);
SiteMapNodeCollection children = siteMapNode.ChildNodes;
if (children != null && children.Count > 0)
{
foreach (SiteMapNode mapNode in siteMapNode.ChildNodes)
{
treeNode.Nodes.Add(this.CreateNode(mapNode));
}
}
return treeNode;
}
private string GetIconCls(Ext.Net.Icon icon)
{
string iconCls = this.ResourceManager1.GetIconClass(icon);
int pos = iconCls.IndexOf("{", StringComparison.OrdinalIgnoreCase);
return iconCls.Substring(1, pos - 1);
}
Спасибо и всего наилучшего.