ListboxItem client-side API

2 posts, 0 answers
  1. Jeroen Eikmans
    Jeroen Eikmans avatar
    50 posts
    Member since:
    May 2009

    Posted 14 Oct 2009 Link to this post

    Hi,

    I've added the following clientcontextmenu to a RadListBox (with checkboxes)
    function showCheckListboxContextMenu(sender, eventArgs) {  
        var menu = $find("<%= checkListboxRadMenu.ClientID %>");  
        if (menu != null) {  
            var item = eventArgs.get_item();  
            var listbox = item.get_listbox();  
            document.getElementById("contextMenuCheckListboxID").value = listbox.get_id();  
            menu.show(eventArgs.get_domEvent());  
        }  

    On the line "var listbox = item.get_listbox();" i get an error Object doesn't support mproperty or method.
    So i replaced the item.get_listbox() with item._parent and then it does work. But i believe it would be better to call the get_listbox() method.

    Any ideas about why i get that error? The client-api documentation states that there is such a method and i even see it in the Visual Studio watch window when i debug the code. I'm using Telerik assembly version 2009.2.701.35
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 14 Oct 2009 Link to this post

    The first thing I noticed was the get_listbox() instead of get_listBox() (notice the "B") which is the way the function is written in the API. Hopefully this little mixup is the source of the problem, I don't know how many times it's happened to me :)
Back to Top