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

How to Add "-- Please Select --"

9 Answers 1623 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
briankb
Top achievements
Rank 2
briankb asked on 31 Dec 2011, 04:57 AM
How do I add another item at index 0 of "-- Please Select --"? 

<input id="coursecats" style="width:400px;"/>

$("#coursecats").kendoDropDownList({
                index: 0,
                dataTextField: "Title",
                dataValueField: "CourseID",
                filter: "contains",
                dataSource: courses
            });

Note: The courses variable is already set on the page and works fine with the Grid and AutoComplete already on the page.

Seems like there is a lot of detail missing from the docs. Are there beta docs somewhere we can access and see more details on the widgets?

9 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 03 Jan 2012, 11:37 AM
Hello Brian,

 
The DropDownList will support option label in the next official release of KendoUI scheduled for the end of January 2012. For now you can add item on the client. Check this jsFiddle demo for more information.

We are working to improve our documentation and will update it as soon as possible.

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Justin
Top achievements
Rank 1
answered on 03 Jan 2012, 07:52 PM
I just solved a similar problem where I wanted to perminantly have "Add Field" displayed by the drop down. Maybe my solution might help you to find yours.

http://www.kendoui.com/forums/ui/dropdownlist/drop-down-display-text.aspx

If you simply want to change whats displayed and not add an actual element to the list you can do something like:
var data = $("#coursecats").kendoDropDownList({
                index: 0,
                dataTextField: "Title",
                dataValueField: "CourseID",
                filter: "contains",
                dataSource: courses
            });
data.text("-- Please Select --");
0
Amol
Top achievements
Rank 1
answered on 10 Mar 2012, 06:15 AM

I am using Kendo UI 2012.1.229.beta

optionLabel:"Please Select..."  Works for me....

see below:

var data = $(
"#coursecats").kendoDropDownList({
index: 0,
dataTextField: "Title",
dataValueField: "CourseID",
filter: "contains",
dataSource: courses,
optionLabel: "Please Select...",
});



0
chris_cf
Top achievements
Rank 2
answered on 31 Mar 2012, 04:01 AM
Is there a way to use a different style on the optionLabel text? Perhaps to make it a lighter color than the real options.
0
Sharon
Top achievements
Rank 1
answered on 23 Jul 2014, 11:46 AM
Is there any way to implement it at kendo combo-box too?
0
Georgi Krustev
Telerik team
answered on 23 Jul 2014, 01:46 PM
Hello Sharon,

Kendo UI ComboBox supports placeholder functionality. If you would like to use an option label, then I will suggest you use the DropDownList widget with filtering (available since Q2 2014). 

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jon
Top achievements
Rank 1
answered on 14 Feb 2019, 06:32 PM
Asks a question about drop down list, get a fiddle about drop down boxes.   SMH.  Kendo tech support is horrible.
0
Jon
Top achievements
Rank 1
answered on 14 Feb 2019, 06:34 PM
Duh! Why would they name it placeholder, when it is in fact a placeholder.  They call it placeholder in every other widget.  However not here.  Here  It is an options label.  SMH
0
Marin Bratanov
Telerik team
answered on 19 Feb 2019, 08:03 AM
Hi Jon,

I agree with you that absolute uniformity would be good to have, and I am sorry that this feature name has caused you difficulties.

To help with such queries and avoid such searches, we offer a lot of online demos and API reference documentation where you can see how different features are called so you can copy from them towards your actual project. I hope that skimming through them will let you see how a certain feature is used/called in the future so you can find that information quickly and efficiently.

For historical reasons (read - to avoid breaking changes) we can't alter that feature name now, though. I hope you understand. After all, only the dropdowns, charts and inputs are several sets of very similar widgets, the rest 50+ are rather unique.


Regards,
Marin Bratanov
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
DropDownList
Asked by
briankb
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Justin
Top achievements
Rank 1
Amol
Top achievements
Rank 1
chris_cf
Top achievements
Rank 2
Sharon
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or