Hello,
I use the follow "edit grid" Typescript code:
this.dataManager = new ej.DataManager({
url: apiUrl,
adaptor: new ej.WebApiAdaptor(),
updateUrl: apiUrl + "/Put",
insertUrl : apiUrl + "/Insert",
deleteUrl : apiUrl + "/Delete",
});
this.gridData = this.dataManager;
Controller:
This solution allow me to get/put/delete data from webapi with an apiUrl and without security tokens.
In my solution is implement an authService and using IdentityServer4. The AuthService set the webApi Tokens. How can I use this AuthService with the ej.DataManager? Or how can I give the Tokens to the ej.DataManager?
For example without ej-grid: I can get the data like this:
import { AuthService } from '../services/auth.service';
constructor(authService: AuthService, apiUrl: string) {
authService.get(apiUrl ).subscribe(result => {
this.products = result.json() as IProduct[];
}, error => console.error(error));
Best Regards
Anis helaoui