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

你可能感兴趣的:(TreePanel)