This is a migrated thread and some comments may be shown as answers.

Change saveAsExcel() request before sending

4 Answers 443 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aleks
Top achievements
Rank 1
Veteran
Aleks asked on 25 Apr 2020, 12:57 AM

Because the grid date filter is still broken (https://github.com/telerik/kendo-ui-core/issues/1864) I have to modify the filter date/time values before the request is made to the server.

I can do this for normal grid filtering by modifying the filter values in the transport parameterMap, however, when I invoke saveAsExcel() the parameterMap is not called and the wrong date/time values are sent to the server.

How can I modify the filter values *before* saveAsExcel() makes the request to the server (just as I do for normal filtering)?

 

4 Answers, 1 is accepted

Sort by
0
Aleks
Top achievements
Rank 1
Veteran
answered on 25 Apr 2020, 01:52 AM
I can see why parameterMap is not called. You pass a DataSource into the ExcelExporter constructor, but then create a new DataSource (without copying the transport options across) and use that to fetch the data.
0
Ivan Danchev
Telerik team
answered on 29 Apr 2020, 05:44 PM

Hello,

Data (for example filter values) can be passed to the server with an AJAX request. This can be done by preventing the excelExport event and sending an AJAX request from the handler with both the Grid data and additional data included as a parameter/-s. The Saving Files on the Server article shows an example.

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Aleks
Top achievements
Rank 1
Veteran
answered on 15 May 2020, 07:19 AM

Thanks, but that's kind of beside the point...

I shouldn't have to override the Excel export and code a whole bunch of stuff outside the grid, it defeats the purpose of having the Excel export there.

 

The whole point of the parameter map is to do just this, and it doesn't work when the Excel export binds the data source.

After all, the whole reason I have to do this is because date time pickers in filters are broken (per my first message).

 

0
Ivan Danchev
Telerik team
answered on 19 May 2020, 05:28 PM

Hello Aleks,

I've raised the priority of the Github issue, so that we can plan it with precedence over issues with lower priority.

As for the Excel export, consider logging your idea for improving the export functionality in our Feedback Portal: https://feedback.telerik.com/kendo-jquery-ui

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Aleks
Top achievements
Rank 1
Veteran
Answers by
Aleks
Top achievements
Rank 1
Veteran
Ivan Danchev
Telerik team
Share this question
or