Table field

From RPM Wiki

Table of contents

Summary

A simple table field for forms and custom fields.

Details

The data is stored as a delimited string and parsed using Javascript for display/edit in the UI.

Setup

The user adds the table field and the add/edit wizard allows them to specify columns in the same style as managing list options.

Sync

  • In the first implementation of this feature the user data strings saved in the database are only parsed on the client, never on the server. This matches current synchronization functionality where field value data is never modified. The downside for now is that the sync can't reorder the data based on user changes to the columns setup.
  • It is possible for cells to completely not match the column headers by content or even count. That may not be ideal, but makes for easier version 1 implementation, and even grossly odd differences won't break anything when rendered.
    • If there are more header cells than cells per row in existing data, the edit page will provide additional inputs for the new columns.
  • Synchronization will always make the existing headers match the headers in the template.

Render

There are 3 ways the string can be rendered as a table by the JavaScript:

  • A span for display. Shows header row.
  • An input for edit. Shows header row and edit controls.
  • A table cell for display within a view. Does not show header row.

Examples

<span class="tableField" colHeads="First%%Two%%See">A%%B%%C||1%%2%%3</span>


<input type="text" class="tableField" colHeads="First%%Two%%See" value="A%%B%%C||1%%2%%3" />


<td class="g15">A%%B%%C||1%%2%%3</td>

Column limit

The global settings file contains a max columns limit.

  • The server-side limit stops the user from adding more columns to the field
  • 9

Row limit

There is no built in row limit

Excel

Import and download uses the raw delimited format. The user can use shells to translate the raw data into something more meaningful.

  • The import doesn't process or validate the data other than removing potentially dangerous input. This means a user could import a hundred cells in a row to a table field setup for 4 columns. It's out of the scope of this version to catch that and it will be trimmed when displayed or edited using the JavaScript render. In other words, the business logic treats table field input as just a string and never parses it into a table.

Misc

  • By design column headers are kept out of cell data (could've used 3rd level delimiter) so import doesn't have to worry about them and display/download in grid is optional.
  • Future versions may include custom column data types

History

  • This page was last modified 19:47, 19 Mar 2008.
  • This page has been accessed 645 times.