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

ListboxItem client-side API

1 Answer 77 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Jeroen Eikmans
Top achievements
Rank 1
Jeroen Eikmans asked on 14 Oct 2009, 09:38 AM
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

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 14 Oct 2009, 03:27 PM
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 :)
Tags
ListBox
Asked by
Jeroen Eikmans
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or