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

Footer Template in ComboBox

1 Answer 168 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 14 Jul 2014, 03:51 AM
I am finding how to put a footer template in ComboBox. I need to put a checkBox in the footer because I want to change my filters when the user  input a text. If checkBox is checked I have to find in different way. Any suggest? Obviously I hope the footer is always visible when the user display the items list.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 15 Jul 2014, 03:08 PM
Hi Alan,

The ComboBox widget does not support footerTemplate. As an alternative solution I suggest putting the checkbox outside of the widget and use the setOptions method to modify the filter that is used by the widget. For example:
<input type="checkbox" id="startswith" />
<br />
<input id="combobox" />
<script>
$("#combobox").kendoComboBox({
  dataSource: {
    data: [{text: "foo", value: 1}, {text: "zoo", value: 2}]
  },
  dataTextField: "text",
  dataValueField: "value",
  filter: "contains"
});
   
  $("#startswith").on('change', function(e) {
    var combo = $("#combobox").data("kendoComboBox");
    combo.setOptions({ filter: this.checked ? "startswith" : "contains" });
  });
</script>

I hope this information will help.

Regards,
Alexander Valchev
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
Alan
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or