PDA

View Full Version : [CLOSED] treepanel in dropdownfield with not lazyload



mirwais
Oct 30, 2013, 9:30 AM
Hello
Please see the following example which is based on examples:/TreePanel/Loaders/Using_Handler/.

The problem is when dropdown is expanded for the first time it does not expand the tree (not loaded yet!). ut the second time it works when expanded.
It's working if there is a delay on the expand listener is set, ( Delay="100").
Lazymode=instance for treeStore is not working.

Is there any other way to achieve it without Delay?



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>


<script type="text/javascript">
var handleExpand=function(dd) {
debugger;
var tree = dd.component;
tree.getRootNode().firstChild.expand();
}
</script>
<!DOCTYPE html>

<html>
<head runat="server">
<title>TreePanel with ajax proxy using HttpHandler - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<h1>TreePanel with ajax proxy using HttpHandler</h1>
<ext:DropDownField ID="DropDownField1" runat="server">
<Component>
<ext:TreePanel ID="TreePanel3" runat="server" Title="Tree" Height="500" Width="200"
Border="false" RootVisible="false">
<Store>
<ext:TreeStore ID="TreeStore2" runat="server" LazyMode="Instance" LazyFill="True">
<Proxy>
<ext:AjaxProxy Url="TreeLoader.ashx" />
</Proxy>
</ext:TreeStore>
</Store>
<Root>
<ext:Node NodeID="0" Text="Root" />
</Root>
</ext:TreePanel>
</Component>
<Listeners>
<Expand Handler="handleExpand(this);"></Expand>
</Listeners>
</ext:DropDownField>


</form>
</body>
</html>

Daniil
Oct 30, 2013, 2:35 PM
Hi @mirwais,

This DropDownField's listeners forces creating its Component.

<AfterRender Handler="this.getPicker();" />

Maybe, it is better to use a TreeStore's Load event in your case?

mirwais
Oct 30, 2013, 3:57 PM
This DropDownField's listeners forces creating its Component.

<AfterRender Handler="this.getPicker();" />


I'll stick with it. Thank you Daniil.