Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing excel export does not work #8058

Closed
eyupyusein opened this issue Nov 25, 2024 · 0 comments
Closed

Preventing excel export does not work #8058

eyupyusein opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
Bug C: Grid F: Excel Export FP: Completed Sync status with associated Feedback Item Next Release Item that will be included in the next official release Regression Broken functionality which was working previously
Milestone

Comments

@eyupyusein
Copy link
Contributor

eyupyusein commented Nov 25, 2024

Description

Kendo UI for jQuery version 2024.2.514 (2024 Q2) appears to have introduced a new feature that shows a loading / progress overlay on the grid when you click the Export button.

Something we do in our grids is call e.preventDefault() if there is no data to export and the button is clicked. That appears to be the recommended approach to prevent an export based on the documentation here: https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/excelexport

While e.preventDefault() does prevent the export, the loading / progress overlay remains on the grid. Furthermore, simply hiding it with JS (e.g. grid.loader.hide() or grid.loaderOverlay.hide()) makes it go away, but the grid is in an unresponsive state (e.g. you can't sort rows or click Export again).

Workaround

You can use the following alternative solution which disables the Export Excel button depending on a condition:

<script>
    function dataBound(e){
        if(true){ // data is 0
           $(".k-grid-excel").addClass("k-disabled");
        }
    }
</script>

Here is a live sample for demonstration:
https://netcorerepl.telerik.com/myFlPxcv57G9CLP123

@eyupyusein eyupyusein added Bug C: Grid F: Excel Export Regression Broken functionality which was working previously labels Nov 25, 2024
@github-actions github-actions bot added the FP: Unplanned Sync status with associated Feedback Item label Nov 25, 2024
@iordanGrancharov iordanGrancharov self-assigned this Dec 3, 2024
@sspasova sspasova self-assigned this Dec 13, 2024
@github-actions github-actions bot added FP: Completed Sync status with associated Feedback Item and removed FP: Unplanned Sync status with associated Feedback Item labels Dec 13, 2024
@sspasova sspasova added this to the 2025 Q1 (Feb) milestone Dec 13, 2024
@sspasova sspasova added the Next Release Item that will be included in the next official release label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug C: Grid F: Excel Export FP: Completed Sync status with associated Feedback Item Next Release Item that will be included in the next official release Regression Broken functionality which was working previously
Projects
None yet
Development

No branches or pull requests

3 participants