$(
"#groups-no-dropdown"
).kendoComboBox({
filter:
"contains"
,
ignoreCase:
true
,
dataTextField:
"Name"
,
dataValueField:
"Id"
,
minLength: 3,
enforceMinLength:
true
,
footerTemplate:
'Total #: instance.dataSource.total() # items found'
,
template:
'<span class="k-state-default"><h3>#: data.Name #</h3><p>#: data.Id #</p></span>'
,
placeholder:
"Enter a Group Name..."
,
filtering:
function
(e) {
console.log(e);
},
dataSource: {
transport: {
read: {
dataType:
"json"
,
url:
'@Url.Action("GetData", "Groups")'
,
type:
"POST"
}
},
parameterMap:
function
(data, type) {
console.log(data);
data = kendo.stringify({ request: { filter: data.filter.field +
"~"
+ data.filter.operator +
"~'"
+ data.filter.value +
"'"
} });
console.log(data);
return
data;
},
serverFiltering:
true
,
schema: {
type:
"json"
,
data:
"Data"
,
total:
"Total"
,
model: {
fields: {
Id: { field:
"Id"
, type:
"guid"
},
Name: { field:
"Name"
, type:
"string"
}
}
}
},
sort: { field:
"Name"
, dir:
"asc"
}
},
height: 400
});ue
The above is my combobox. You can see parameter map, but regardless if I remove parameter map or not. The data gets posted as:
filter[logic]:and
filter[filters][0][value]:eng
filter[filters][0][field]:Name
filter[filters][0][operator]:contains
filter[filters][0][ignoreCase]:true
Also why is the posted data different from data in the parameter map function? It seems like additional processing is happening. Here is what is spit out to console inside parameterMap function:
{filter: {…}, sender: init, _defaultPrevented:
false
, preventDefault: Æ’, isDefaultPrevented: Æ’}
filter:{value:
"eng"
, field:
"Name"
, operator:
"contains"
, ignoreCase:
true
}
isDefaultPrevented:Æ’ ()
preventDefault:Æ’ ()
sender:init {ns:
".kendoComboBox"
, element: I.fn.init(1), _events: {…}, options: {…}, _isSelect:
false
, …}
_defaultPrevented:
false
__proto__: Object
Which is structured differently than what is being posted.