dont fire open or preview events if no list item is selected

This commit is contained in:
rlx 2011-01-11 11:16:54 +00:00
parent 6353bcd8ba
commit e10d2fc56a

View File

@ -6713,12 +6713,15 @@ requires
}
function open() {
that.triggerEvent('open', {
ids: getSelectedIds()
var ids = getSelectedIds();
ids.length && that.triggerEvent('open', {
ids: ids
});
}
function preview() {
var ids = getSelectedIds();
if (ids.length) {
self.preview = !self.preview;
if (self.preview) {
that.triggerEvent('openpreview', {
@ -6728,6 +6731,7 @@ requires
that.triggerEvent('closepreview');
}
}
}
function scroll() {
var page = self.page;
@ -7178,6 +7182,7 @@ requires
id: '',
max: -1,
min: 0,
pageLength: 100,
selected: [],
request: function() {}, // {sort, range, keys, callback}
sort: []
@ -7267,6 +7272,7 @@ requires
}),
max: self.options.max,
min: self.options.min,
pageLength: self.options.pageLength,
orientation: 'vertical',
request: self.options.request,
selected: self.options.selected,
@ -7525,7 +7531,8 @@ requires
var $input,
html = $cell.html(),
index = getColumnIndexById(key),
width = self.options.columns[index].width;
column = self.options.columns[index],
width = column.width;
Ox.print($item, $cell)
$cell.empty()
.addClass('OxEdit')
@ -7533,6 +7540,7 @@ requires
width: width + 'px'
});
$input = Ox.Input({
autovalidate: column.input.autovalidate,
style: 'square',
value: html,
width: width
@ -7545,13 +7553,12 @@ requires
})
.bindEvent({
blur: submit,
submit: submit
})
.appendTo($cell)
.focus();
function submit() {
var value = $input.value();
$input.remove();
//$input.loseFocus().remove();
$cell.removeClass('OxEdit')
.css({
width: (width - 8) + 'px'