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

Embed a search box in the menu bar

5 Answers 457 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Stephen Graham
Top achievements
Rank 1
Stephen Graham asked on 01 Nov 2012, 11:54 AM
Hi,

Has anybody managed to put a search box onto the main part of the menu bar? I can get it into a menu item, but not on the main bar.
Is this possible?

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 06 Nov 2012, 01:25 PM
Hi Stephen,

You can take a look at the following example:

http://jsfiddle.net/dimodi/wu5Wj/

All the best,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Stephen Graham
Top achievements
Rank 1
answered on 06 Nov 2012, 01:38 PM
Hi,

sadly that won't work using the MVC helper.... is it possible from there?

ie

@(Html.Kendo().Menu()
      .Name("Menu")
      .Items(items =>
      {
          items.Add()
              //I'd like an input in here....!
0
Dimo
Telerik team
answered on 08 Nov 2012, 12:24 PM
Hi Stephen,

I am sorry about the misunderstanding, however, please note that this is the non-MVC Kendo UI forum and you have not indicated that you are using the MVC helpers. Hence my reply was targeted at the pure client-side Menu widget.

You can set Encoded(false) for the item and inject the desired HTML markup with Text().

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Karika
Top achievements
Rank 1
answered on 20 Dec 2012, 09:33 PM
How can you inject HTML code in .Text?
e.g.
items.Add().Text(@<text><input type="text" name="searchString" placeholder="Quick Search" title="Quick Search" id="quickSearchInput" class="k-textbox" spellcheck="true" autofocus="autofocus" autocomplete="on" /></text>).Encoded(false);
0
Dimo
Telerik team
answered on 21 Dec 2012, 08:22 AM
Hello Karika,

You can inject HTML code as an ordinary string.

items.Add().Text("<input type='text' />").Encoded(false);

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