fix some issues
This commit is contained in:
@ -208,7 +208,8 @@ export class Grid {
|
||||
throw new Error('no source');
|
||||
}
|
||||
if (!Array.isArray(array) || array.length <= 0) {
|
||||
throw new Error(`invalid items array: ${array}`);
|
||||
// throw new Error(`invalid items array: ${array}`);
|
||||
return;
|
||||
}
|
||||
const it = index >= 0 ? this._var.currentSource[index] : null;
|
||||
if (it != null) {
|
||||
@ -260,10 +261,11 @@ export class Grid {
|
||||
if (this._var.currentSource == null) {
|
||||
throw new Error('no source');
|
||||
}
|
||||
if (!Array.isArray(indexes) || indexes.length <= 0) {
|
||||
throw new Error(`invalid selected indexes: ${indexes}`);
|
||||
if (Array.isArray(indexes) && indexes.length > 0) {
|
||||
indexes = indexes.slice().sort();
|
||||
} else {
|
||||
indexes = this._var.currentSource.map(a => a.__index);
|
||||
}
|
||||
indexes = indexes.slice().sort();
|
||||
const array = [];
|
||||
let first = 0;
|
||||
for (let i = indexes.length - 1; i >= 0; --i) {
|
||||
|
Reference in New Issue
Block a user