Matrix Data Editor

Ben Scott (NHM), Gregor Hagedorn & Andreas Plank (JKI)

KEY RESOURCES

The Slickgrid Drupal module

The management of data in a matrix structure, familiar from spreadsheets, is a very common requirement that arises in a bewildering number of places. The Slickgrid module is an implementation of Michael Leibman's jquery slickgrid plugin, a lightening fast JavaScript grid/spreadsheet.

The module defines a slickgrid view style, so all data can be output as an editable grid.

Features of the grid:

  • Grouping field - group fields with a common value together
  • Collapsible taxonomy fields (tree structures)
  • Tabs - organise columns into tabs
  • Resize, reorder & hide columns
  • Delete entities via the grid
  • Force fit columns (to fill the available column space)
  • Undo (undo previous changes - uses node revisions)
  • Set viewport height
  • Set row height
  • Add entities via the grid*
  • Clone entities*
  • Export data (via the views data export module)*
  • Multi edit/delete/clone/export (checkboxes will be displayed in the rows - select as many rows as you want to perform action against)*
 grid editor
 * Drupal 7 version only.  Grid Editor

 

At the front end, users can show/hide, resize, reorder columns & resize the height of the grid. These settings will be stored per user and used next time the grid is shown. Saving the view (via the usual views UI) will reset these settings.

For every field defined in the view, you can set its column width, whether it's sortable, and formatters (how the cell data is displayed), an editor, a validator and filters (for filtering the column data).

This modules comes with the following plugins ready to use:

Editors:

  • Inline cell editor - for excel-like editing of text & numeric data.
  • Popup field form - the field form pops up in an overlay. All field types can be edited.

Validators:

  • Required inline field

Filters:

  • Text filter (case-insensitive text filter - if the column cell contains the text it will be displayed)

Formatters:

  • Collapsible taxonomy fields - build tree structures based on the taxonomy terms (D7 Only)

Requirements & recommendations

Drupal 6 version requires the following modules:

Drupal 7 version requires the following modules:

If using the grid as an editor, it's best used with Editor views so nodes can be filtered based on edit & delete permissions. Currently this module is Drupal 6 only.

Slickgrid uses adaptive virtual scrolling, and can handle hundreds of thousands of rows. If you want to use Slickgrid with large datasets you'll probably need to install Views batch page which loads views via the batch API & prevents out of memory problems. Currently this module is Drupal 6 only.

jQuery version

jQuery is a JavaScript library that makes it easy to create web effects in just a few lines of code.

Drupal 6
Requires jQuery 1.4.3 & jQuery UI 1.8.5. These libraries are included and added to all slickgrid views pages.

Drupal 7
Requires jQuery 1.5.2 - so this module requires the jquery_update module.

SDD-specific matrix editors

The decision to upgrade Scratchpads from Drupal 6 to Drupal 7 meant that resources to investigate alternative matrix editors that can be used outside Drupal and dedicated to the production of SDD (Structured Descriptive Data) were not available. Nevertheless, JKI developed a prerequisite: a simple but powerful relational information model for matrix data, based on earlier DELTA and DiversityDescriptions models, but improved to capture essential newer developments and compatible with the SDD standard was developed and implemented in mysql. For this a simple user interface primarily focussed on quick by-taxon data capture was developed. First steps towards a full, js-based matrix editor, were evaluated, but some problems encountered.