Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > PanelBar > RadPanelBar javascript/jquery issue

Not answered RadPanelBar javascript/jquery issue

Feed from this thread
  • Posted on Jan 17, 2012 (permalink)

    Hello,

    I've a RadPanelBar on a dynamiclly loaded UserControl. In that UserControl I've placed a RadScriptBlock where my javascript functions are defined. I'm trying to execute the get_element() and/or get_items() functions but I always get the error that the function is not supported.
    var $ = $telerik.$;
     
    var categoryPanelBar = $(this).find("<%=RadPanelBar1.ClientID%>");
     
    alert(categoryPanelBar.get_items());

    With this code the PanelBar object can be found only the function get_items() will not be excuted because it tells me that this function is not support for the element.

    Can someone help me with this?

    Regards,
      Jos Meerkerk,

    Reply

  • Kate Kate admin's avatar

    Posted on Jan 20, 2012 (permalink)

    Hello Jos,

    You get the following error since the jQuery find method accepts either a selector, a jQuery object or an element while in your case you use none of the just mentioned ones. However, using the following code you can achieve the desired effect:
    <telerik:RadScriptBlock runat="server" ID="block1">
        <script type="text/javascript">
            function pageLoad() {
                var categoryPanelBar = $find("<%=RadPanelBar1.ClientID%>");
                var item = categoryPanelBar.findItemByText("item1");
                item.disable();
            }
        </script>
    </telerik:RadScriptBlock>

    Please note that we would recommend that you use our flexible client-side API.

    Regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

  • Posted on Jan 20, 2012 (permalink)

    Kate,

    thnx for your reply but unfortunately this doesn't work.

    When I use:
    var categoryPanelBar = $find("<%=RadPanelBar1.ClientID%>");

    then categorypPanelBar is null

    But when I use:

    var categoryPanelBar = $(this).find("<%=RadPanelBar1.ClientID%>");

    an [object] is found

    But stil the methods are not valid for the object.

    The problem occurs with implementing the Telerik Schedule example with WebServices (http://demos.telerik.com/aspnet-ajax/scheduler/examples/webservice/defaultcs.aspx) on a Dynamiclly loaded User Control.

    Regards,
      Jos

     

     

     

    Reply

  • Kate Kate admin's avatar

    Posted on Jan 21, 2012 (permalink)

    Hello Jos,

    Please refer to the attached runnable page that works as expected from my end (I can find the RadPanelBar object and access its properties). Can you modify it in a way so that it demonstrates the issue so I can help you out?

    All the best,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
    Attached files

    Reply

  • Posted on Jan 23, 2012 (permalink)

    Kate,

    as mentioned before my User Control is loaded dynamically. Could that be the difference??
    I will try you're example.

    Regards,
      Jos Meerkerk

    Reply

  • Posted on Jan 23, 2012 (permalink)

    Kate,

    with your example everything work's fine. Is there an explanation for the fact that things do not work when implementing it in my application?

    Regards,
      Jos

    Reply

  • Ivana Ivana admin's avatar

    Posted on Jan 25, 2012 (permalink)

    Hello Jos,

    Attached is a sample project which uses the following approach to find a client object of a control which is placed inside a user control:
    function pageLoad() {
        var paneljQuery = $telerik.$("[id$='_RadPanelBar1']");
        var panelBarObj = $find(paneljQuery.attr("id"));
        alert("The PanelBar Object: " + panelBarObj.get_id());
        alert("The number of items: " + panelBarObj.get_items().get_count());
    }
    var paneljQuery = $telerik.$("[id$='_RadPanelBar1']"); -- finds the jQuery object of a control which ID ends on the '_RadPanelBar1' string.

    $find(paneljQuery.attr("id")); -- finds the client object of the control which ID is passed as a parameter.

    I hope this helps.

    Greetings,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > PanelBar > RadPanelBar javascript/jquery issue
Related resources for "RadPanelBar javascript/jquery issue"

[  ASP.NET PanelBar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]