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
|
|
@ -62,16 +62,19 @@ Ox.TreeList = function(options, self) {
|
|||
max: self.options.max,
|
||||
min: self.options.min,
|
||||
unique: 'id'
|
||||
}, Ox.extend(Ox.clone(self), {updateCallbacks: []})) // pass event handler
|
||||
})
|
||||
.addClass('OxTableList OxTreeList')
|
||||
.css({
|
||||
width: self.options.width + 'px',
|
||||
overflowY: 'scroll'
|
||||
})
|
||||
.bindEvent({
|
||||
anyclick: clickItem,
|
||||
select: selectItem,
|
||||
toggle: toggleItems
|
||||
.bindEvent(function(data, event) {
|
||||
if (event == 'anyclick') {
|
||||
clickItem(data);
|
||||
} else if (event == 'toggle') {
|
||||
toggleItems(data);
|
||||
}
|
||||
that.triggerEvent(event, data);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue