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

Client side object trouble

3 Answers 37 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 19 Feb 2009, 02:48 PM

I'm trying to create an instance of the client side object for a panelbar and it keeps telling me that the method does not exist.  I'm using the following code.

                var panelbar = $find("<%=RadPanelBar1.ClientID%>");
                var item = panelbar._findItemByText("PATIENT IS GOOD MATCH");
                item.set_text("New Text");


<cc1:RadPanelBar ID="RadPanelBar1" runat="server" Skin="WebBlue"
            Width="500px" ExpandMode="SingleExpandedItem" style="text-align: left;">
            <ExpandAnimation Type="OutQuint" Duration="400" />
            <CollapseAnimation Type="OutQuint" Duration="300" />
            
            <Items>
            
                <cc1:RadPanelItem runat="server" Text="PATIENT IS GOOD MATCH" />

.........



thanks for you help,

Ben

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 19 Feb 2009, 03:25 PM
Hello Ben,

The code below works just fine on our side. Let us know what's different in your case.

<form id="form1" runat="server"
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"
</telerik:RadScriptManager> 
 
<script type="text/javascript"
function setText() 
var panelbar = $find("<%= RadPanelBar1.ClientID%>"); 
var item = panelbar.findItemByText("PATIENT IS GOOD MATCH"); 
if(item) 
    item.set_text("New Text"); 
</script> 
 
<telerik:RadPanelBar ID="RadPanelBar1" runat="server"
<CollapseAnimation Type="None" Duration="100"></CollapseAnimation> 
<Items> 
    <telerik:RadPanelItem runat="server" Text="PATIENT IS GOOD MATCH"
    <Items> 
        <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1"
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2"
        </telerik:RadPanelItem> 
    </Items> 
    </telerik:RadPanelItem> 
</Items> 
<ExpandAnimation Type="None" Duration="100"></ExpandAnimation> 
</telerik:RadPanelBar> 
<input id="Button1" type="button" value="button" onclick="setText()" /></p
</form> 


Greetings,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ben
Top achievements
Rank 1
answered on 19 Feb 2009, 07:43 PM
I just tried it on FireFox and it worked yet on IE7 it throw a javascript error:

Error: 'null' is null or not an object

on this line:
var item = panelbar._findItemByText("PATIENT IS GOOD MATCH");


Thanks,

Ben
0
Paul
Telerik team
answered on 20 Feb 2009, 06:56 AM
Hi Ben,

We tried to repro the issue on our side using the latest version of the control, but to no avail. I think it will be best if you can open a support ticket and send us a simple running project (incl. CSS, images, DB backup and so on) demonstrating the problems. In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Greetings,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
PanelBar
Asked by
Ben
Top achievements
Rank 1
Answers by
Paul
Telerik team
Ben
Top achievements
Rank 1
Share this question
or