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

template as dataTextField

2 Answers 1340 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Maxim
Top achievements
Rank 1
Maxim asked on 17 Apr 2012, 05:26 PM
Hi,

Is there a way to define dataTextField to be a template? Perhaps it may be a good idea to define two new properties displayTemplate and valueTemplate to make control more flexible and customizable on client side.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Apr 2012, 12:26 PM
Hello Maxim,

 
Currently display template is not supported. You can share your thoughts in our UserVoice. Thus other users can vote for such functionality.

Regards,
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
Jerry T.
Top achievements
Rank 1
answered on 24 May 2012, 08:12 PM
According to this demo, templates *are* supported:

http://demos.kendoui.com/web/dropdownlist/template.html

maybe not for the dataTextField property, itself, but there's a template property.  Here's another example from my own code:

portion of the column definition:
    var columns = [
        { field: "CostCategoryAbv", title: "Cat", width: 45, editor: comboboxCostCategory },

and here's the editor function:

    function comboboxCostCategory(container, options) {
        $("<input name='" + options.field + "' style='width:275px;'/>")
     .appendTo(container)
     .kendoDropDownList({
         autoBind: false,
         dataSource: me.costCategoryDataSource,
         dataTextField: "CostCatAbv",
         dataValueField: "CostCatAbv",
         template: "${ data.CostDescription }"
     });
    };

Tags
DropDownList
Asked by
Maxim
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jerry T.
Top achievements
Rank 1
Share this question
or