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

Combobox Placeholder breaks page layout

1 Answer 69 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 29 Aug 2014, 02:12 PM
I have an input element that I am using as a ComboBox, which works great:

<input id="imtSelect" name="IMT" required data-required-msg="IMT is required." data-bind="value: imt">

I have it configured down in the "function" part of the page I am working on:
var imtData = [ "US", "Canada", "Federal" ];
// create ComboBox for IMT...
$("#imtSelect").kendoComboBox({
    dataSource : imtData,
    index : 0
});

However, if I try to add the "placeholder" attribute to the combobox, it throws/breaks all formatting on the page.  The TabStrip, the other comboboxes, date pickers --- basically the styles/classes are no longer in effect.

Here is what I change it to:
$("#imtSelect").kendoComboBox({
    dataSource : imtData,
    index : 0
    placeholder : "Select..."
});

I have also tried to define this attribute in the input element itself (placeholder="Select..."), but it has no effect -- it does not appear in the combobox.

Not sure what I am doing incorrect.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 02 Sep 2014, 07:23 AM
Hello Dan,

The code snippet that adds the placeholder option has a missing comma:
index : 0 [here]
placeholder : "Select..."
This is invalid JavaScript and the widget will not initialize and every JavaScript widget after this declaration. Please add the missing comma and let me know if the problem still persists:
$("#imtSelect").kendoComboBox({
    dataSource : imtData,
    index : 0,
    placeholder : "Select..."
});

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ComboBox
Asked by
Dan
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or