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

Combobox template on custom grid editor

3 Answers 182 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 27 Mar 2013, 12:46 AM
I have some issue related to the template for combobox.

My combobox has template defined:
<script id="Items_template" type="text/x-kendo-template">
${data.NameLang}(${data.Code})
</script>

This is the definition of combobox:
 @(Html.Kendo().ComboBox()
                      .Name("Item_Description")
                      .DataTextField("NameLang")
                      .DataValueField("NameLang")
                      .Filter(FilterType.Contains)
                      .DataSource(action => action.Read(read => read.Action("GetItemsForPAByName", "StockCount")))
                      .Value(Model.Item_Description)   
                      .HtmlAttributes(new {style="width:240px"}) 
                      .TemplateId("Items_template")
                      )
As a result on the list I get undefined(undefined).
Same definition and template not located on the custom grid editor is working fine.

Is this some issue with combobox styling ?
Is there any workaround ?

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 28 Mar 2013, 02:09 PM
Hello Tomasz,

I am not sure what exactly is the case you have:

Can you update this jsbin to replicate the issue so we can search for a solution?

http://jsbin.com/eduvej/3/edit

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tomasz
Top achievements
Rank 1
answered on 28 Mar 2013, 02:42 PM
First of all.
1. The issue occur when you use an template editor for grid (popup window).
2.If I place an combobox on the editor template and put there as well an template definition for combobox.

<script id="Items_template" type="text/x-kendo-template">
${data.NameLang}(${data.Code})
</script>

then it seems that combobox cant locate this template(Items_template).

I found the solution.
Just place the "Items_template"  on the main page ( where grid is located ) and it will start to work.
Same issue I got with the template for an error messages.
If I place template on the editor for grid then it is not taken.
If I place it on main page it works.

 <script id="tooltip-template" type="text/x-kendo-template">
    <span class = "k-widget k-tooltip k-tooltip-validation k-invalid-msg" > <span class = "k-icon k-warning" > </span>#=message#</span>
</script>

I am not sure if it will be possible to recreate it using jsbin.
0
Petur Subev
Telerik team
answered on 01 Apr 2013, 07:36 AM
Hello Tomasz,

Please check the attached project. There is editor template used for the PersonID field which is a ComboBox with template.

If I missed something modify the project and send it back.

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Tomasz
Top achievements
Rank 1
Share this question
or