forked from 0x2620/oxjs
simplify event passing in Ox.List derivatives
This commit is contained in:
parent
91275f7171
commit
7df61a8ac9
4 changed files with 20 additions and 23 deletions
|
|
@ -253,7 +253,7 @@ Ox.TableList = function(options, self) {
|
|||
sums: self.options.sums,
|
||||
type: 'text',
|
||||
unique: self.options.unique
|
||||
}, Ox.extend(Ox.clone(self), {updateCallbacks: []})) // pass event handler
|
||||
})
|
||||
.addClass('OxBody')
|
||||
.css({
|
||||
top: (self.options.columnsVisible ? 16 : 0) + 'px',
|
||||
|
|
@ -266,15 +266,13 @@ Ox.TableList = function(options, self) {
|
|||
that.$head && that.$head.scrollLeft(scrollLeft);
|
||||
}
|
||||
})
|
||||
.bindEvent({
|
||||
cancel: function(data) {
|
||||
.bindEvent(function(data, event) {
|
||||
if (event == 'cancel') {
|
||||
Ox.Log('List', 'cancel edit', data);
|
||||
},
|
||||
edit: function(data) {
|
||||
} else if (event == 'edit') {
|
||||
that.editCell(data.id, data.key);
|
||||
},
|
||||
select: function() {
|
||||
self.options.selected = that.$body.options('selected');
|
||||
} else {
|
||||
that.triggerEvent(event, data);
|
||||
}
|
||||
})
|
||||
.appendTo(that);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue