mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 14:56:01 +00:00
filter this value in formview
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import _ from 'lodash';
|
||||
import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc } from './GridConfig';
|
||||
import { ForeignKeyInfo, TableInfo, ColumnInfo, EngineDriver, NamedObjectInfo, DatabaseInfo } from 'dbgate-types';
|
||||
import { parseFilter, getFilterType } from 'dbgate-filterparser';
|
||||
import { parseFilter, getFilterType, getFilterValueExpression } from 'dbgate-filterparser';
|
||||
import { filterName } from './filterName';
|
||||
import { ChangeSetFieldDefinition, ChangeSetRowDefinition } from './ChangeSet';
|
||||
import { Expression, Select, treeToSql, dumpSqlSelect, Condition } from 'dbgate-sqltree';
|
||||
@@ -30,6 +30,21 @@ export class FormViewDisplay {
|
||||
}));
|
||||
}
|
||||
|
||||
filterCellValue(column, rowData) {
|
||||
if (!column || !rowData) return;
|
||||
const value = rowData[column.uniqueName];
|
||||
const expr = getFilterValueExpression(value, column.dataType);
|
||||
if (expr) {
|
||||
this.setConfig((cfg) => ({
|
||||
...cfg,
|
||||
filters: {
|
||||
...cfg.filters,
|
||||
[column.uniqueName]: expr,
|
||||
},
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
setFilter(uniqueName, value) {
|
||||
this.setConfig((cfg) => ({
|
||||
...cfg,
|
||||
|
||||
Reference in New Issue
Block a user