How to attach to OnClientItemsRequested in JS?

2 posts, 0 answers
  1. Branimir Giurov
    Branimir Giurov avatar
    2 posts
    Member since:
    Aug 2007

    Posted 24 Oct 2013 Link to this post


    I have the following script rendering in my aspx:

    Sys.Application.add_load(function () {
        var target = $find('{0}');
        //finds it
        $addHandler(target, "OnClientItemsRequested", function (sender, e) { alert('OnClientItemsRequested'); });
        $addHandler(target, "onclientItemsRequested", function (sender, e) { alert('onclientItemsRequested'); });
        $addHandler(target, "clientItemsRequested", function (sender, e) { alert('clientItemsRequested'); });
        $addHandler(target, "clientitemsrequested", function (sender, e) { alert('clientitemsrequested'); });
        $addHandler(target, "onclientitemsrequested", function (sender, e) { alert('onclientitemsrequested'); });
        //none fires

    The alert showing server id fires, nothing else happens after using the auto-populate, while the same event works when I configure the event-handler in combobox's properties.

    My problem is none of the subscriptions works, so is there a way to attach an event-handler function for OnClientItemsRequested in JS?

    Thx in advance,
    Branimir Giurov
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Oct 2013 Link to this post

    Hi Branimir,

    To attach the OnClientItemsRequested client event of the RadComboBox from JavaScript, you must use the add_itemsRequested method as shown in the following sample code.

    <telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientLoad="OnClientLoad"

    <script type="text/javascript">
        function OnClientLoad(sender, args) {
        function OnClientItemsRequested(sender, args) {
            //Your Code

Back to Top