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

JSONP remote data with call function

1 Answer 130 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Karel asked on 23 Sep 2012, 04:47 PM

I have a problem with data source for autocomplete. I get data from remote service via callback function which fills global json object. I need to use this object as a datasource but I don't know how to refresh datasource because I don't have method. Is there a way how to refresh datasource somehow?

This code could help to clafiry:

YAHOO = { Finance: { SymbolSuggest: { ssCallback: function (jsn) { YAHOOsuggest = jsn; return (jsn); } } } };
function InitializeStockInput() {
        dataSource: new{
            data: YAHOOsuggest.ResultSet.Result,
            type: "json"
        placeholder: "Select stock...",
        minLength: 1,
        dataTextField: "name",
        dataValueField: "symbol"
function StockInputChanged(sender) {
    var url=''+ sender.value +'&callback=YAHOO.Finance.SymbolSuggest.ssCallback';
function helper(url) {
    var head = document.getElementsByTagName('head')[0];
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = url; = 'helperScript';
    script.onload = cleaner;
function cleaner() {

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 27 Sep 2012, 07:24 AM
Hello Karel,

If you have already have loaded the data without the DataSource, you can use its data method to set it. e.g.

var autoComplete = ("#stockInput").data("kendoAutoComplete");;
Also, note that the AutoComplete does not support a value field and if you need to use separate fields for the text and value you should use ComboBox instead. Regards,
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question