Giter Club home page Giter Club logo

silverstripe-gridfieldqueuedexport's Introduction

GridField Queued Export

Build Status Scrutinizer Code Quality Code Coverage

Introduction

Allows for large data set exports from a GridField. By using an asynchronous job queue, we avoid running out of PHP memory or exceeding any maximum execution time limits.

The exact limitations of a standard GridField export vary based on the server configuration, server capacity and the complexity of the exported DataObject. As a rough guide, you should consider using this module when more than 1000 records need to be exported. The module should be able to export 10,000 records on a standard server configuration within a few minutes.

Requirements

Note: For SilverStripe 3.x, please use the 1.x release line.

Installation

To install run composer require silverstripe/gridfieldqueuedexport.

Configuration

Since this component operates on a GridField, you can simply use it's addComponent() API.

$gridField = new GridField('Pages', 'All pages', SiteTree::get())
$config = $gridField->getConfig();
$config->addComponent(new GridFieldQueuedExportButton('buttons-after-left'));

If you want to replace the GridFieldExportButton created by the default GridField configuration, you also need to call removeComponentsByType().

// Find GridField
$gridField = $fields->fieldByName('MyGridField');
$config = $gridField->getConfig();

// Add new component
$oldExportButton = $config->getComponentByType('GridFieldExportButton');
$config->addComponent($newExportButton = new GridFieldQueuedExportButton('buttons-after-left'));

// Set Header and Export columns on new Export Button
$newExportButton->setCsvHasHeader($oldExportButton->getCsvHasHeader()); 
$newExportButton->setExportColumns($oldExportButton->getExportColumns());

// Remove original component
$config->removeComponentsByType('GridFieldExportButton');

Note: This module is preconfigured to work with the silverstripe/userforms submission CSV export.

Related

silverstripe-gridfieldqueuedexport's People

Contributors

assertchris avatar brettt89 avatar chillu avatar dhensby avatar igor-silverstripe avatar kinglozzer avatar raissanorth avatar robbieaverill avatar

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.