fix some issues
This commit is contained in:
parent
56262d6766
commit
0696ecaff0
@ -312,7 +312,9 @@ export class GridDateColumn extends GridColumn {
|
||||
|
||||
static setValue(element, val) {
|
||||
if (element.tagName === 'INPUT') {
|
||||
if (isNaN(val)) {
|
||||
if (val === '') {
|
||||
element.value = '';
|
||||
} else if (isNaN(val)) {
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(val)) {
|
||||
element.value = val;
|
||||
} else if (/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(val)) {
|
||||
|
4
lib/ui/grid/grid.d.ts
vendored
4
lib/ui/grid/grid.d.ts
vendored
@ -275,10 +275,10 @@ export class Grid {
|
||||
removeItem(index: number): GridItem;
|
||||
/**
|
||||
* 批量删除行数据
|
||||
* @param indexes 待删除的行索引数组
|
||||
* @param indexes 待删除的行索引数组,未传值时删除所有行
|
||||
* @returns 返回已删除的行数据数组
|
||||
*/
|
||||
removeItems(indexes: Array<number>): Array<GridItem>;
|
||||
removeItems(indexes?: Array<number>): Array<GridItem>;
|
||||
/**
|
||||
* 滚动到指定行的位置
|
||||
* @param index 待滚动至的行索引
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user