issue: customer communication contacts grid height.
change: replace schedule date control. change: date validation from 1753-01-01 to 9999-12-31.
This commit is contained in:
@ -445,8 +445,9 @@ export class GridDropdownColumn extends GridColumn {
|
||||
* @param {any} val
|
||||
* @param {GridItemWrapper} wrapper
|
||||
* @param {GridColumnDefinition} col
|
||||
* @param {Grid} grid
|
||||
*/
|
||||
static setValue(element, val, wrapper, col) {
|
||||
static setValue(element, val, wrapper, col, grid) {
|
||||
if (element.tagName !== 'DIV') {
|
||||
let source = this._getSource(wrapper, col);
|
||||
if (source instanceof Promise) {
|
||||
@ -460,19 +461,42 @@ export class GridDropdownColumn extends GridColumn {
|
||||
if (drop == null) {
|
||||
return;
|
||||
}
|
||||
const ignoreCase = col.dropRestrictCase !== true;
|
||||
if (drop.source == null || drop.source.length === 0) {
|
||||
let source = this._getSource(wrapper, col);
|
||||
if (source instanceof Promise) {
|
||||
source.then(s => {
|
||||
drop.source = s;
|
||||
drop.select(val, true);
|
||||
drop.select(val, true, ignoreCase);
|
||||
})
|
||||
return;
|
||||
} else if (source != null) {
|
||||
drop.source = source;
|
||||
}
|
||||
}
|
||||
drop.select(val, true);
|
||||
if (typeof val === 'string' && val !== '') {
|
||||
const lVal = String(val).toLowerCase();
|
||||
const item = drop.source.find(s => {
|
||||
let v = s[col.dropOptions?.valueKey ?? 'value'];
|
||||
if (ignoreCase) {
|
||||
return String(v).toLowerCase() === lVal;
|
||||
}
|
||||
return v === val;
|
||||
});
|
||||
if (item == null) {
|
||||
let text;
|
||||
if (col.text == null && typeof col.filter === 'function') {
|
||||
text = col.filter(wrapper.values, false, grid._var.refs.body);
|
||||
} else {
|
||||
text = val;
|
||||
}
|
||||
drop.source.push({
|
||||
[col.dropOptions?.textKey ?? 'text']: text,
|
||||
[col.dropOptions?.valueKey ?? 'value']: val
|
||||
});
|
||||
}
|
||||
}
|
||||
drop.select(val, true, ignoreCase);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user