Expand Panelitem from client side error

1 posts, 0 answers
  1. A K
    A K avatar
    49 posts
    Member since:
    Apr 2010

    Posted 23 Apr 2010 Link to this post

    Following  are  2 paneltems in the panel bar.  On button click of btnAddAccountChecking I am trying to expand  CheckingAddUserControl panel item. It does expand the panel item but after that it breaks on Telerik general   undefined object null javascript error  .

    This is the code to attach java function for CheckingAddUserControl Client side processing.

    Dim btnAddChecking As ImageButton = CType(pnlTopLevel.Items().FindItemByValue("CheckingAdd").Items().FindItemByValue("CheckingAddbtn").FindControl("btnAddAccountChecking"), ImageButton)

    Dim openWinScript As String = "SetVisibility('CheckingAddUserControl');"

                      btnAddChecking.OnClientClick = openWinScript

    This is the JavaScript Function:

         <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  

        <script type="text/javascript">

               

                function SetVisibility(itemValue) {

                      var panelBar = $find("<%= pnlBarAccounts.ClientID %>");

                      var panelItem = panelBar.findItemByValue(itemValue);

                      panelItem.expand();

             }

                

        </script>

    </telerik:RadCodeBlock>

    These are the panelitems

     

    <telerik:RadPanelItem value="CheckingAdd" runat="server" Text="CheckingAdd" Expanded="true" style="display:none;">

                                                    <Items>

                                                          <telerik:RadPanelItem value="CheckingAddbtn" runat="server" Text="" Expanded="true">

                                                                <ItemTemplate>

                                                                      <br />

                                                                      <asp:ImageButton ID="btnAddAccountChecking" runat="server"  />

                                                                </ItemTemplate> 

                                                          </telerik:RadPanelItem>

                                                    </Items>

                                                     </telerik:RadPanelItem>

                                              <telerik:RadPanelItem value="CheckingAddUserControl" runat="server" Expanded="false" Visible="true">

                                                    <Items>    

                                                          <telerik:RadPanelItem  runat="server" Expanded="true" >

                                                                <ItemTemplate>

                                                                      <UC1:CheckingAcct ID="CheckingAcct1" runat="server"   AcctID="0" />

                                                                </ItemTemplate> 

                                                          </telerik:RadPanelItem>

                                                    </Items>

                                              </telerik:RadPanelItem>

Back to Top