I have an auto complete cell within parent/child grid.
Below is my code. However if i add executequery against datamanager. It does not allow. since API which i am hitting is SharePoint REST API. and it does not allow tolower in search which i am getting if i dont pass my own search. I end up getting failed request while i type my search. Can I add search in my Odata query it self. if yes, then how can i access data (typed in auto complete box). also, how do i modify the execute query. which is throwing me an error. but if i remove this
then everything works as expected
|
class CustomAdaptor extends ODataAdaptor {
public convertToQueryString(
request: Object,
query: Query,
dm: DataManager
): string {
// request will have the filter query.
// you can change it with the below value
let value = document.getElementById('NormalgridCustomerID').ej2_instances[0]
.typedString;
let original: string = super.convertToQueryString.apply(this, arguments);
return original;
}
}
export class AppComponent {
public columns: Object[] = [
{
field: 'CustomerID',
headerText: 'Customer ID',
validationRules: { required: true },
width: 140,
type: 'string',
edit: {
. . .
write: function (args) {
this.dObj = new AutoComplete({
dataSource: new DataManager({
url: 'https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders',
adaptor: new CustomAdaptor(),
crossDomain: true,
headers: [{ accept: 'application/json;odata=verbose' }],
}),
fields: { text: 'CustomerID', value: 'CustomerID' },
value: args.rowData['CustomerID'] ? args.rowData['CustomerID'] : '',
});
this.dObj.appendTo(this.elem);
},
},
},
];
|
Somehow I am not able to make this work. why it keeps adding other filters at the end ?
|
class CustomAdaptor extends ODataAdaptor {
public convertToQueryString(request: Object, query: Query, dm: DataManager): string {
delete request.$filter;
let value = document.getElementById('NormalgridCustomerID').ej2_instances[0]
.typedString;
debugger;
let original: string = super.convertToQueryString.apply(this, arguments);
return original;
}
}
|