extjs TreePanel 加载数据后默认选中第一个孩子并展开子级

 <ext:TreePanel ID="BudgetTree" runat="server" Title="科目分类" RootVisible="false"
                 UseArrows="true" AutoScroll="true" Animate="true" Width="220" Split="true" Region="West">
                 <Root>
                     <ext:AsyncTreeNode NodeID="root" Text="root" />
                 </Root>
                 <Loader>
                     <ext:TreeLoader DataUrl="/Org/GetBudgetSort">
                         <BaseParams>
                             <ext:Parameter Name="pId" Value="node.id" Mode="Raw" />
                             <ext:Parameter Name="IsLoadLeaf" Value="true" Mode="Value" />
                         </BaseParams>
                         <Listeners>
                             <Load Handler="SetDefaultNode(node)" />
                         </Listeners>
                     </ext:TreeLoader>
                 </Loader>
                 <Listeners>
                     <Click Fn="LoadBudget" />
                 </Listeners>
             </ext:TreePanel>

 

jsCode
posted @ 2012-08-01 15:16  rpoplar  阅读(1050)  评论(0编辑  收藏  举报