1
0
Fork 0
forked from 0x2620/oxjs

simplify event passing in Ox.List derivatives

This commit is contained in:
rolux 2012-06-30 11:20:37 +02:00
commit 7df61a8ac9
4 changed files with 20 additions and 23 deletions

View file

@ -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);