This is a migrated thread and some comments may be shown as answers.

Expand Panelitem from client side error

0 Answers 56 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 23 Apr 2010, 06:59 PM

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>

No answers yet. Maybe you can help?

Tags
PanelBar
Asked by
A K
Top achievements
Rank 1
Share this question
or