Skip to content

Commit d2edf48

Browse files
committed
Grid Editing: Cleanup Editor and Grid-Editor options and callbacks
1 parent 444ddb6 commit d2edf48

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

grid-editing/editor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
(function( $ ) {
1111

1212
$.widget( "ui.editor", {
13+
options: {
14+
editor: null,
15+
editorOptions: null,
16+
17+
// callbacks
18+
cancel: null,
19+
submit: null
20+
},
1321
_create: function() {
1422
this.inner = this.element.wrapInner( "<div class='editor-wrapper'></div>" ).children();
1523
this._bind({

grid-editing/grid-editor.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,21 @@ $.widget( "ui.gridEditor", {
1616
editorOptions: function( cell, grid ) {
1717
return grid.options.columns[ cell[ 0 ].cellIndex ].editorOptions;
1818
},
19-
done: $.noop
19+
items: "td"
2020
},
2121
_create: function() {
2222
var grid = this.element.data("grid");
2323
this._bind({
2424
dblclick: function( event ) {
25-
var that = this;
2625
var target = $( event.target ).closest( this.options.items );
2726
if ( target.length && !target.data( "editor" ) ) {
2827
target.editor({
2928
editor: this.options.editor( target, grid ),
3029
editorOptions: this.options.editorOptions( target, grid ),
31-
cancel: function( event, ui) {
32-
that._trigger( "done", event, ui );
33-
},
3430
submit: function( event, ui) {
3531
var object = target.closest("tr").data( "grid-item" ),
3632
property = grid.options.columns[ target[ 0 ].cellIndex ].property;
3733
$.observable( object ).property( property, ui.value );
38-
that._trigger( "done", event, ui );
3934
}
4035
}).editor("start");
4136
}

0 commit comments

Comments
 (0)