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

[Solved] Auto-complete many question

6 Answers 209 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Julien
Top achievements
Rank 1
Julien asked on 03 Apr 2012, 07:23 AM
Hi,

I've several question about the auto-complete mode(with on demand load) of the combo-box:

  1. How can I associate an ID with each response? I can do it without any problem with combobox/Dropdownlist, but not with autocomplete
  2. I need that the autocomplete box display directly the data I'm sending to him(without trying to filter again, because the filtering is done server side, and I return some data which doesn't have the text in the title.
  3. Is there any way to do some client template with the object received?
  4. Which event indicates me that a proposition has been choosed and how can I get the id of the specified element?
  5. How can I configure the delay before the server is queried?
  6. Is there a way to put a text in the autocomplete field by default, which doesn't trigger a server request? (e.g. "Search in your element") and when you click this text disappear?

Thank you!

6 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 06 Apr 2012, 08:27 AM
Hello Julien,

 
Straight upto your questions:

#1: The AutoComplete component does not support such functionality. If you need to associate the "ID" property then you will need to use the ComboBox.

#2: Unfortunately, this is not supported. You can achieve your if you override some of the predefined filters:

var autocomplete = $('#AutoComplete').data("tAutoComplete");
 
//set filter
autocomplete.filter = 0
autocomplete.filters[0] = function(component, data) {
     component.dropDown.dataBind(data, component.encoded);
}

#3: Currently, this is not supported. 

#4:
You can try to get the index of the selected LI in the change event:
function onChange() {
     var autocomplete = $(this).data("tAutoComplete"),
           index = autocomplete.dropDown.$items.filter(".t-state-selected").index();
 
     var dataItem = autocomplete.data[index];
}

#5: You need to use DataBinding method:
.DataBinding(binding => binding.Ajax().Delay(1000))

#6: The "placeholder" functionality is not supported. You can set the placeholder attribute to the input element and browsers like Chrome, FireFox and IE10 will show the empty text message.

Kind regards,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
ronald
Top achievements
Rank 1
answered on 07 Apr 2012, 12:26 PM
number #4 is missing .Value

function onChange() {
var autocomplete = $(this).data("tAutoComplete"),
index = autocomplete.dropDown.$items.filter(".t-state-selected").index();
var dataItem = autocomplete.data[index].Value;
}
0
Julien
Top achievements
Rank 1
answered on 10 Apr 2012, 06:32 AM
It's shameful, it seems that base jquery UI  autocomplete offers more option than yours...

Don't do a tools if it will be useless due to the lack of options...
0
Georgi Krustev
Telerik team
answered on 10 Apr 2012, 10:09 AM
Hello Julien,

 
You can check the Kendo AutoComplete. It supports most of the required functionalities.

Greetings,
Georgi Krustev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Alan Mosley
Top achievements
Rank 1
answered on 01 Jun 2012, 03:43 PM
This answers my question also. I wondered if the new Kendo mvc auto complete with do this?
0
Sohaib
Top achievements
Rank 1
answered on 27 Dec 2012, 11:05 AM
how can we show the by default selected value in kendo ui autocomplete which is coming from database?

 $("#alert1").kendoAutoComplete({
                dataValueField: "id",
                dataTextField: "name",
                dataSource: sharedDataSource,
                filter: "startswith",
                placeholder: "Select Responsible...",
                separator: "",
                

                 
            });

I want to show first index name when values are populated to kendo autocomplete.
Tags
ComboBox
Asked by
Julien
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
ronald
Top achievements
Rank 1
Julien
Top achievements
Rank 1
Alan Mosley
Top achievements
Rank 1
Sohaib
Top achievements
Rank 1
Share this question
or