Giter VIP home page Giter VIP logo

ss-gridfield-utils's Introduction

GridField Utilities

GridField Utilities are a collection of GridField components that you can use with any GridField.

Includes the following (note they all live in the namespace Milkyway\SS\GridFieldUtils):

  • AddNewInlineExtended: A more complex version of GridFieldAddNewInlineButton, allowing you to set custom fields, rather than copying GridFieldEditableColumns (defaults to this behaviour)
  • EditableRow: adds an expandable form to each row in the GridField, allowing you to edit records directly from the GridField.
  • HasOneSelector: Allow you to select a has one relation from the current GridField
  • AddExistingPicker: Works exactly like the one in gridfieldextensions, except it allows you to add more before closing the window - allowing for a faster workflow (requires silverstripe-australia/gridfieldextensions)
  • MinorActionsHolder: Defines a new fragment that will holds SS UI buttons as a dropdown (not touch friendly)
  • AddNewModal: Opens up the detail form in a modal window
  • FormatSwitcher: Allows you to switch between different GridField formats
  • RangeSlider: Filter your GridField using a slider, for a more user-friendly option for viewing lots of records
  • HelpButton: Add a help button to your GridField that you can supply content for (will open a modal dialog)
  • SaveAllButton: Will execute all components on the GridField that implement the GridField_SaveHandler (for use in ModelAdmin where there is no save button)
  • DisplayAsTimeline: Will change the display of your GridField to a timeline (probably not be compatible with custom GridField Components, but compatible with framework GridField Components)
  • GridFieldDetailForm: Works exactly the same as the standard GridFieldDetailForm, with ability to change the url segment (hence having multiple GridFieldDetailForms on the one GridField)
  • GridFieldAddNewButton: An add button for the above GridFieldDetailForm

Caveats

  • The DisplayAsTimeline component is very hacky at this stage, due to the lack of support for templates in GridField. It has only been tested in Google Chrome
  • The SaveAllButton will be VERY slow when your objects are versioned and there are many of them
  • A deep nested EditableRow will be very slow, since it has many request handlers to access, but not much I can do about this behaviour...

Additional notes

You will need to install the milkyway-multimedia/ss-mwm-formfields module to use the RangeSlider component.

Requirements

Install

Add the following to your composer.json file


    "require"          : {
		"milkyway-multimedia/ss-gridfield-utils": "0.4"
	}

Suggested Packages

Credits

  • ajshort: He did most of the coding of GridFieldExtensions, which I borrowed for the more complex versions in this module
  • silverstripe-australia: They now look after the GridFieldExtensions module, and have done some updates which I have probably borrowed

TODO

  • Screenshots!!
  • Make MinorActionsHolder touch friendly
  • Get DisplayAsTimeline to work with sorting (just in case)
  • Make RangeSlider work with Date Range Fields / Any Range Fields
  • Test RangeSlider more

License

  • MIT

Version

  • Version 0.4 (Alpha)

Contact

Milkyway Multimedia

ss-gridfield-utils's People

Contributors

mellm0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ss-gridfield-utils's Issues

modules die in php5.3

You're using "trait" instead of class which only works in PHP5.4 and up, same with using [] instead of array(). Please update the dependencies for this module or rewrite to suit lower PHP versions.

BUG: Class Eventful does not exist

I pulled in this module through composer (this also pulls in your other module). After doing a dev/build & flush, I get a 'Class Eventful does not exist' error.

UploadField error in EditobleRow

When I add an UploadField inside EditableRow, it produces an 'File information not found' error on upload of a file. It seems the uploadfield::upload action cannot find the correct record/field to save data into(?)

I've tried explicitly setting the record & name on the uploadfield but that doesn't resolve it.

public function upload(SS_HTTPRequest $request) {
        ...
        $name = $this->getName();
        $tmpfile = $request->postVar($name);
        $record = $this->getRecord();

        if (!$tmpfile) {
            $return = array('error' => _t('UploadField.FIELDNOTSET', 'File information not found'));
            ...

GF utils seems to cause an error in CMS/SSViewer

After I add the gridfield-utils through composer and do a ?flush=all, the pages section of the CMS dies with an error (both dev-master & 0.3, on FW/CMS 3.3.0 & 3.3.1);

Notice at line 1094 of /webroot/framework/view/SSViewer.php

ERROR [User Warning]: None of the following templates could be found (no theme in use): CMSPagesController_ContentToolbar.ss
IN GET /domain.tld/site/admin/pages/treeview
Line 818 in /webroot/framework/view/SSViewer.php

I have no clue where to even start debugging this, hope you do.

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.