diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 73f1d8ea..ecc4de10 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -6645,7 +6645,8 @@ requires var $cell, $item = findItem(e), pos, - editTimeout = false; + clickable, editable, + clickTimeout = false; selectTimeout = false; that.gainFocus(); if ($item) { @@ -6670,11 +6671,15 @@ requires selectTimeout = true; } else if (self.options.type == 'text') { $cell = findCell(e); - if ($cell && $cell.hasClass('OxEditable') && !$cell.hasClass('OxEdit')) { - if (self.options.sortable) { - editTimeout = true; - } else { - triggerEditEvent($item, $cell); + if ($cell) { + clickable = $cell.hasClass('OxClickable'); + editable = $cell.hasClass('OxEditable') && !$cell.hasClass('OxEdit'); + if (clickable || editable) { + if (self.options.sortable) { + clickTimeout = true; + } else { + triggerCellEvent($item, $cell, clickable ? 'click' : 'edit'); + } } } } @@ -6695,8 +6700,8 @@ requires if (self.dragTimeout) { clearTimeout(self.dragTimeout); self.dragTimeout = 0; - if (editTimeout) { - triggerEditEvent($item, $cell); + if (clickTimeout) { + triggerCellEvent($item, $cell, clickable ? 'click' : 'edit'); } } }); @@ -6932,8 +6937,9 @@ requires } } - function triggerEditEvent($item, $cell) { - that.triggerEvent('edit', { + function triggerCellEvent($item, $cell, event) { + // event can be 'click' or 'edit' + that.triggerEvent(event, { id: $item.data('id'), key: $cell.attr('class').split('OxColumn')[1].split(' ')[0].toLowerCase() }); @@ -7051,6 +7057,7 @@ requires that.closePreview = function() { self.preview = false; + return that; }; that.reload = function() { @@ -7065,6 +7072,15 @@ requires that.scrollToSelection = function() { self.selected.length && scrollToPosition(self.selected[0]); + return that; + }; + + that.setId = function(oldId, newId) { + var index = self.ids.indexOf(oldId); + if (index > -1) { + self.ids[index] = newId; + } + return that; }; that.size = function() { // fixme: not a good function name @@ -7099,6 +7115,7 @@ requires emptyFirstPage(); fillFirstPage(); } + return that; } that.sortList = function(key, operator) { @@ -7113,6 +7130,10 @@ requires return that; } + that.value = function(id, key, value) { + + }; + return that; }; @@ -7150,7 +7171,6 @@ requires .addClass('OxItem') .attr({ draggable: self.options.draggable - //id: self.options.id.replace(/./g, '_') // fixme: dots are not the only problem }) .data({ id: self.options.id, @@ -7460,6 +7480,7 @@ requires var $cell = $('