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

ComboBox hits server twice, first time with null parameter

1 Answer 76 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 07 Mar 2014, 03:50 PM
For some reason my kendoComboBox, with server side filtering, is hitting my MVC controller twice, the first time with no data. Any idea why this is happening? 

Also another note, I do not need all the fancy filter criteria that is sent by kendo, I send a term, and perform an OR search across address fields. 


$('#ELEMENT').width(700).kendoComboBox({
dataSource: addressDS,
dataTextField: "NAME",
dataValueField: "ID"
});


var addressDS = new kendo.data.DataSource({
        schema: {
            model: {
                id: "ID",
                fields: {
                    ID: {type: "number"},
                    NAME: {type: "string"},
                    ADDRESS1: {type: "string"},
                    CITY: {type: "string"},
                    STATE: {type: "string"},
                    ZIP: {type: "string"},
                    COUNTRY: {type: "string"},
                    
                }
            },
            data: function(data) {
                return data.Results;
            },
            total: function(data) {
                return data.ResultCount;
            }
            
        },
        transport: {
            read: {
                type: 'json',
                url: '/Address/Autocomplete'
            },
            parameterMap: function(data, type) {
                return {
                    term: $('#ELEMENT').val()
                };
            }
        },
        serverFiltering: true
    });

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 10 Mar 2014, 12:51 PM
Hello Josh,

Generally speaking, the combobox will make a request on load in order to retrieve the corresponding data.
If you need to avoid initial binding then you can set the autoBind option to false. If I am missing something, then I would like to ask you to send us a simple jsBin/jsFiddle demo  which reproduces the issue.

Regards,
Georgi Krustev
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
Josh
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or