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
});
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
});