Is there an EmptyText property in the combobox like you have in the silverlight combobox? If not, what is the best way to go about duplicating that functionality? In the old days I would just set it and clear it in the gotfocus / onfocus events, is that how it shoud be done here or is there an easier way?
8 Answers, 1 is accepted
0
Hello Kjell,
Georgi Krustev
the Telerik team
This functionality is in our TODO list and is scheduled for the next official release of Kendo UI. Currently, you can achieve your goal using focus/blur event to add/clear the text.
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
Kjell
Top achievements
Rank 1
answered on 08 Feb 2012, 06:01 AM
I am having trouble getting the onblur and onfocus events to fire. Here is my input definition:
and the js which sets up the combobox:
Neither event fires, though if I comment out the above javascript and just leave "clientCombo" as a regular input, then the alerts work fine. I tried changing the event names to "focus" and "blur" just in case your post was meant to be taken literally, but that did not work. I also tried defining the focus event in the js which sets up the combo, that didn't work but I probably wasn't doing it right:
<
input
id
=
"clientCombo"
value
=
"Type Client Name/Number"
style
=
"color: DarkGray"
onfocus
=
"javascript:alert('focus');"
onblur
=
"javascript:alert('blur');"
/>
and the js which sets up the combobox:
$(
"#clientCombo"
).width(300).kendoComboBox()}
Neither event fires, though if I comment out the above javascript and just leave "clientCombo" as a regular input, then the alerts work fine. I tried changing the event names to "focus" and "blur" just in case your post was meant to be taken literally, but that did not work. I also tried defining the focus event in the js which sets up the combo, that didn't work but I probably wasn't doing it right:
$(
"#clientCombo"
).width(300).kendoComboBox({
focus: alert(
'asdf'
)
});
0
Hello Kjell,
Setting the width of the input element works fine on my end. Check this jsFiddle demo.
Greetings,
Georgi Krustev
the Telerik team
After create ComboBox widget from input element, it will be hidden. You will need to wire the focus/blur event of the visible input element. Here how you can get the visible input:
var
combo = $(
"#clientCombo"
).width(300).kendoComboBox().data(
"kendoComboBox"
);
var
visibleInput = combo.input;
Setting the width of the input element works fine on my end. Check this jsFiddle demo.
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
Kjell
Top achievements
Rank 1
answered on 21 Feb 2012, 08:46 PM
Can you add the visibleinput part to your example? When I tried it, "visibleInput" was undefined. All I need is something really basic like just have it change the color of the text on blur or focus for example.
0
Accepted
Hi,
Georgi Krustev
the Telerik team
Here is a simple jsFiddle demo, which shows how to wire the focus/blur event of the visible input. Let me know if other questions arise.
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
Kjell
Top achievements
Rank 1
answered on 22 Feb 2012, 09:51 PM
Thanks, that's exactly what I needed.
0
Trent Jones
Top achievements
Rank 1
answered on 23 Jul 2012, 03:44 PM
Is this feature now included in the code. I can't find any documentation about it?
0
Hello,
Georgi Krustev
the Telerik team
I will suggest you check the placeholder property of the Combobox.
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!