Opened 11 years ago

Closed 6 years ago

#6730 closed enhancement (wontfix)

Add extension point to Grid editing to intercept edits

Reported by: John Locke Owned by: Bryan Forbes
Priority: high Milestone: future
Component: DojoX Grid Version: 1.1.0
Keywords: Cc: john@…
Blocked By: Blocking:

Description (last modified by John Locke)

When hooking a grid up to a DojoData? store, you can have columns that do not correspond to data fields. While you can set the values of these columns using get and/or formatter functions, you can't do anything to capture the results of editing.

Specifically, capturing a change of a checkbox (dojox.grid.editors.Bool) is not possible from the grid definition.

For this specific editor, changing the dojox.grid.editors.AlwaysOn? definition to call the cell.applyEdit instead of the grid.edit.applyCellEdit allows you to override cell.applyEdit (which calls grid.edit.applyCellEdit) provides for a nice extension point. With this change, I can provide an "applyEdit" parameter in the view, and capture the change in the checkbox without it going back to the model.

Proposed change:

$ svn diff dojox/grid/_data/
Index: dojox/grid/_data/editors.js
===================================================================
--- dojox/grid/_data/editors.js (revision 13680)
+++ dojox/grid/_data/editors.js (working copy)
@@ -212,9 +212,9 @@
                this.formatNode(this.getNode(inRowIndex), inDatum, inRowIndex);
        },
        applyStaticValue: function(inRowIndex){
-               var e = this.cell.grid.edit;
-               e.applyCellEdit(this.getValue(inRowIndex), this.cell, inRowIndex);
-               e.start(this.cell, inRowIndex, true);
+               var c = this.cell;
+               c.applyEdit(this.getValue(inRowIndex),inRowIndex);
+               c.grid.edit.start(this.cell, inRowIndex, true);
        }
 });

Change History (5)

comment:1 Changed 11 years ago by John Locke

Description: modified (diff)

Corrected module definition for Bool.

comment:2 Changed 11 years ago by Nathan Toone

Milestone: 1.3

comment:3 Changed 11 years ago by Bryan Forbes

Owner: changed from sorvell to Bryan Forbes

comment:4 Changed 10 years ago by Bryan Forbes

Milestone: 1.3future

comment:5 Changed 6 years ago by dylan

Resolution: wontfix
Status: newclosed

This is from the old pre 1.2 grid. Closing as wontfix.

Note: See TracTickets for help on using tickets.