Hi Samuel,
Greetings from Syncfusion.
We have analyzed your query. We could see that the “undefined” values shown in “RawValue” is for the “checkbox” column, since the field property will not be provided for the “checkbox” column, its showing as undefined. We suggest you to push only the columns to the “searchSettings.field” property to avoid undefined in query(only the columns in “searchSettings.field” will be included during searching). Please refer the code below,
<script>
var grid = new ej.grids.Grid({
dataSource: new ej.data.DataManager({
url: "/api/Values",
adaptor: new ej.data.WebApiAdaptor(),
crossDomain: true
}),
...
actionBegin:function(args){
if (args.requestType == "searching") {
for (var i = 0; i < this.getColumns().length; i++) {
if (this.getColumns()[i].field) {
this.searchSettings.fields.push(this.getColumns()[i].field) //These columns fields will only be included in searching. So
}
}
}
},
...
});
grid.appendTo("#Grid");
</script>
|
Documentations :
We have prepared a sample based on this scenario to perform searching in Grid when bound data with “WebApiAdaptor”. We are attaching the sample for your convenience. Please download the sample from the link below,
We would also like to suggest you to refer to the “controller” code section of the below KB link, in which we have included the code to perform server side “searching” when using Web API service.
Please get back to us if you need further assistance.
Regards,
Thavasianand S.