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

can not get control by name.

3 Answers 181 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Iron
Vincent asked on 28 Oct 2018, 10:40 AM

i use the follow code, but it is not working

var listbox=$('#listboxname').data('kendoListBox')

2018 r3

 

3 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 29 Oct 2018, 01:47 PM
Hi Vincent,

The Kendo UI ListBox widget might return undefined value in case it does not have matching ids in the following three places:
  • The id in the select element. When using the .NET Core wrapper the id will match the string from the Name() option.
  • The id where the widget is initialized (accessing it using jQuery and calling the kendoListBox() method)
  • The id where you refer to an existing instance

I have created a sample Dojo project which demonstrates how to access a listBox and select the second element in its collection. Give the abovementioned suggestion a try and get back to us in case you need further assistance.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vincent
Top achievements
Rank 1
Iron
answered on 10 Nov 2018, 09:53 AM

Thank you very much. My problem is :I write the code in the top of page. maybe the control not initialized.

 

0
Tsvetomir
Telerik team
answered on 14 Nov 2018, 11:52 AM
Hi Vincent,

Accessing a widget that has not been initialized yet will result in an undefined value. I cannot give a firm confirmation whether this is a problem on your side because I do not have sufficient information on your specific set-up. 

If the issue persists, attach the files responsible for initializing and accessing the Kendo UI ListBox in an official Support Ticket and I will thoroughly investigate the case locally. 


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ListBox
Asked by
Vincent
Top achievements
Rank 1
Iron
Answers by
Tsvetomir
Telerik team
Vincent
Top achievements
Rank 1
Iron
Share this question
or