Giter Site home page Giter Site logo

Comments (2)

MikeAlhayek avatar MikeAlhayek commented on May 27, 2024

@clarketm I think the main culprit with the script is the getExportData() function. I change my code so it manually exports the data as you can see in the below code, but the call to getExportData() takes forever to finish executing which causes the browser to slow down.

$(function (e) {
    'use strict';

    var tables = $('.exportable');

    if (!tables.length) {
        return;
    }

    $('<button class="btn btn-primary manual-export-to-xls" title="Export To Excel">Export To Excel</button>').insertBefore(tables);

    $(document).on('click', '.manual-export-to-xls', function (el) {
        var tbl = $(this).parent().parent().find('.export-table').first();
        var table = new TableExport(tbl, {
            formats: ['xls'],
            exportButtons: false,
            bootstrap: true,
            trimWhitespace: true
        });

        var data = table.getExportData(); // This call takes forever to finish which kills the browser.

        var exportData = data['export-buttons-table']['xls'];

        table.export2file(exportData.data, exportData.mimeType, exportData.filename, exportData.fileExtension);
    });
});

from tableexport.

MikeAlhayek avatar MikeAlhayek commented on May 27, 2024

Pull request #195 fixes this problem once and for all. I tested the outcome on one report I have, the time to export the data went down from 12 seconds to 1! Yes, 10-11 seconds less without browser issue while not impacting the page load.

from tableexport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.