Hello,
I'm using Data Grid component in angular 5 project. When i click on 'export data' option, excel file is created but without data, only with column names.
I use odata store type to fetch data. On each filter and page change, request is send to server to fetch data. Here is how dataSource property of the data grid is set:
…
this.dataSource == {
store: {
type: "odata",
version: 4,
url: this.actionUrl + "userLogins/getAll",
onLoading(loadOptions) {
loptions = loadOptions.filter ? loadOptions.filter : "";
},
beforeSend(xhr) {
xhr.headers["Content-Type"] = "application/x-www-form-urlencoded";
xhr.headers["Accept"] = "application/json";
xhr.headers["LanguageCulture"] = hed.headersLanguage;
xhr.headers["Authorization"] = "Bearer " + hed.authService.getUser().access_token;
if (loptions)
xhr.params["$filter1"] = JSON.stringify(loptions);
},
},
select: [
"UserTimeOfAction",
"UserName",
"ApplicationName",
"ClientId",
"UserAction"
],
};
…
Can you tell me if i'm missing something?
Thank you,
Ivancho