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

Update Template content dynamically

3 Answers 344 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 2
Iron
Veteran
Iron
Rob asked on 10 Jul 2015, 08:37 AM

Hey Guys

Here's another odd one and I wonder if there is any way to do this.

I use a template to provide additional information about the selection and ideally I want to refresh this every X seconds without having to reload the whole data source.

 Currently this extra info is added using the template:

template: '<div class="k-state-default"><span class = "left">#: data.Name #</span><span class="right">(#: data.waittime #)</span>',

Is there any way I can update the 'waittime' part of the template without having to refresh the whole datasource. ? ( I guess reloading the whole datasource will screw up the current selection)

I'm doubtful , but hopeful :)

Many thanks In advance

 Rob

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Rob
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 13 Jul 2015, 12:52 AM

After trying lots of things ( including updating the actual HTML values of the templates via Java) I have settled on just changing to Server side Filtering so I am always returning refreshed wait times when ever the user opens the auto complete or searches.

 

Seems like a pretty good solution all round.. 

 

Rob

0
Accepted
Georgi Krustev
Telerik team
answered on 14 Jul 2015, 08:57 AM
Hello Rob,

The rendering of the AutoComplete items are directly related to the DataSource. If you would like to update the displayed text, you will need to update the source. Here is a demo that shows how to accomplish this task:
Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Rob
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 12 Aug 2015, 12:22 AM
Thanks . that could be very useful for future projects :)
Tags
AutoComplete
Asked by
Rob
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Rob
Top achievements
Rank 2
Iron
Veteran
Iron
Georgi Krustev
Telerik team
Share this question
or