TableEditor
Flexible in place editing of TableSorter
PURPOSE
TableEditor provides flexible in place editing of HTML tables.
User defined handler functions can easily be dropped in to, for example,
update the data source via an AJAX request.
PREVIEW
REQUIREMENTS
TableEditor is a jQuery plugin.
It requires jQuery (1.0.3 recommended) and should be used in
conjunction with Christian Bach's
TableSorter
plugin. Future versions will likely function independant of
TableSorter.
FILES
README
Use documentation in the works. See Example(s), Program Flow, and source comments in tableEditor.js
EXAMPLES
PROGRAM FLOW
On table load, assign an "edit" event to all elements matching the configurable EVENT_LINK selector (by default; all table cell links of class "tsEditLink").
When "edit" event is called;
- Execute PRE_EDIT function (if defined)
- Change "edit" event link to "save" event
- Disable sorting on table
- Make row cells editable
- Execute POST_EDIT function (if defined)
When "save" event is called;
- Execute PRE_SAVE function (if defined)
- Make row cells non-editable, cache changed & original values to pass to UPDATE function
- Clear tableSorter's cache
- Execute UPDATE function (if defined)
CHANGES
- Added flexible method of adding a row (jQuery.tableEditor.lib.appendRow(...))
- Table options can now be accessed globally via the VAULT
- TableEditors can coexist on the same page at the same time
- Speed up selection and assignment of edit event links
- Added marking columns as noEdit [COL_NOEDIT_SELECTOR: ".noEdit"]
- Added toggling of header class inheritance [COL_APPLYCLASS]
- Bugfixes on HTML elements
- Added function to restore a row to its originals (if an update fails) to $.tableEditor.lib.restoreRow(row, originals)
TODO
- Add intuitive+toggable ability to "cancel" edit
- Add intuitive+toggable ability to "delete" rows
- Make integration with tableSorter more seamless. I'd like to only extend the object...
- Demonstrate AJAX request/handling to update table's datasource using A) CSV File B) MySQL table
- Offer version independent of tableSorter
- Off Topic: Extend scope of validation library so that it's unique per object
(c) 2006 - Brice Burgess