DataGridField

Warning
This product has not had a release in over 1 year and may no longer be maintained.
by Jarn last modified Jul 07, 2011 01:24 PM

A table input component for Plone. Uses Javascript to make entering tabular data more user friendly process - there are no round trip HTTP requests to the server when inserting or deleting rows.

Project Description

DataGridField

Released under the GNU General Public License

Features

  • Any number of columns set by a developer
  • Any number of rows filled by a user
  • Insert and deleting rows without submitting a form
  • Many different column types

Requirements

  • A browser with Javascript support. There isn't yet graceful degeneration for browsers without or disabled Javascript.

Quality

  • Tested with Firefox 2.0, IE 6

Usage examples

Simple example with three free text columns:

        schema = BaseSchema + Schema((

        DataGridField('DemoField',
                widget = DataGridWidget(),
                columns=('column1','column2','The third')
                ),
        ))

Complex example with different column types and user friendly labels:

        # Plone imports
        from Products.Archetypes.public import DisplayList
        from Products.Archetypes.public import *

        # Local imports
        from Products.DataGridField import DataGridField, DataGridWidget
        from Products.DataGridField.Column import Column
        from Products.DataGridField.SelectColumn import SelectColumn

        class DataGridDemoType(BaseContent):
            """A simple archetype

            """

            schema = BaseSchema + Schema((
                DataGridField('DemoField',
                        searchable = True,
                        columns=("column1", "column2", "select_sample"),
                        widget = DataGridWidget(
                            columns={
                                'column1' : Column("Toholampi city rox"),
                                'column2' : Column("My friendly name"),
                                'select_sample' : SelectColumn("Friendly name", vocabulary="getSampleVocabulary")
                            },
                         ),
                 ),

                ))

            def getSampleVocabulary(self):
                """
                """
                """ Get list of possible taggable features from ATVocabularyManager """  
                return DisplayList(

                    (("sample", "Sample value 1",),
                    ("sample2", "Sample value 2",),))

For more examples, see unit test code.

Notes

  • Since DataGridField 1.5, if you wish to retain old way of automatic row inserting. Here is a bit logic behind all this - otherwise there will be an extra row added when you edit DGF and press save. o You must set property auto_insert = True to DataGridWidget o You must set property allow_empty_rows = False to DataGridField

Known features

  • Sometimes on Firefox column sizes start changing after the user enters some data. Not sure if this is a Firefox bug, though.
  • Prefilled default values work only for text and select columns
  • Radio button and link column postback is not handled propeply. This needs fixes to very deep into Zope (ZPublisher). If the form validation fails, link column and radio button columns lost their values.

Demo

A demo type is included. Set INSTALL_DEMO_TYPES = True in config.py to enable it. It is disabled by default. This type is neither pretty nor very functional, but demonstrates how a data grid should be used. Also, to run unit tests, you need to set this variable. I couldn't come up with a nice hack which would tell config.py whether it's imported from unit testing framework or not.

References

Custom Search product uses DataGridField for editing search form query fields.

London School of Marketing site uses DataGridField extensively

Contributors

People who have been making this true:

  • Mikko Ohtamaa, Red Innovation
  • Danny Bloemendaal
  • Radim Novotny
  • Justin Ryan
  • Alexander Limi
  • Jarn
  • Martin Aspeli
  • Paul Everitt
  • Development was helped by Vincent Bonamy

Original concept and prototype:

  • Geir Bækholt, Jarn
  • Paul Everitt, Zope Europe Association

Sponsorship

Organizations paying up for the development

Current Release
Products.DataGridField datagridfield-1.6.2

Released Jun 01, 2010

Download file Get DataGridField for all platforms
Products.DataGridField-1.6.2.zip
Download file Get DataGridField for all platforms
Old-style tarball
If you are using Plone 3.2 or higher, you probably want to install this product with buildout. See our tutorial on installing add-on products with buildout for more information.

All Releases

Version Released Description Compatibility Status
datagridfield-1.8b1 More about this release… beta
datagridfield-1.8a2 More about this release… alpha
datagridfield-1.6.2 Jun 01, 2010 More about this release… final
1.8a1 Plone 4 only release. More about this release…
Plone 4
alpha
1.6.1 Nov 04, 2009 Bug fix. More about this release…
Plone 3
Plone 2.5
final
1.6 Jan 28, 2009 Plone 2.5, 3.x compatibility / new features More about this release…
Plone 3
Plone 2.5
final
1.5.0 Jan 03, 2007 Major production release More about this release…
Plone 2.5.2
Plone 2.1.3
final
1.0b5 Mar 06, 2006 Fix-ups to the selection-widget code, support for row re-ordering and cross-browser bug fixes More about this release… final
0.3 Feb 18, 2006 Major feature enhancements More about this release…
Plone 2.1.2
Plone 2.1.1
final
0.2 Oct 17, 2005 First public release More about this release…
Plone 2.1
Plone 2.0.5
Archetypes 1.3
final

Comments (0)