Pass other values from process into possible values (for filter)

This commit is contained in:
2023-03-08 10:22:18 -06:00
parent 39eea433fb
commit b6d79817de
5 changed files with 71 additions and 39 deletions

View File

@ -48,6 +48,7 @@ interface Props
isMultiple?: boolean;
bulkEditMode?: boolean;
bulkEditSwitchChangeHandler?: any;
otherValues?: Map<string, any>;
}
DynamicSelect.defaultProps = {
@ -61,6 +62,7 @@ DynamicSelect.defaultProps = {
isEditable: true,
isMultiple: false,
bulkEditMode: false,
otherValues: new Map<string, any>(),
bulkEditSwitchChangeHandler: () =>
{
},
@ -68,7 +70,7 @@ DynamicSelect.defaultProps = {
const qController = Client.getInstance();
function DynamicSelect({tableName, processName, fieldName, fieldLabel, inForm, initialValue, initialDisplayValue, initialValues, onChange, isEditable, isMultiple, bulkEditMode, bulkEditSwitchChangeHandler}: Props)
function DynamicSelect({tableName, processName, fieldName, fieldLabel, inForm, initialValue, initialDisplayValue, initialValues, onChange, isEditable, isMultiple, bulkEditMode, bulkEditSwitchChangeHandler, otherValues}: Props)
{
const [ open, setOpen ] = useState(false);
const [ options, setOptions ] = useState<readonly QPossibleValue[]>([]);
@ -112,7 +114,7 @@ function DynamicSelect({tableName, processName, fieldName, fieldLabel, inForm, i
(async () =>
{
// console.log(`doing a search with ${searchTerm}`);
const results: QPossibleValue[] = await qController.possibleValues(tableName, processName, fieldName, searchTerm ?? "");
const results: QPossibleValue[] = await qController.possibleValues(tableName, processName, fieldName, searchTerm ?? "", null, otherValues);
if(tableMetaData == null && tableName)
{
@ -237,8 +239,6 @@ function DynamicSelect({tableName, processName, fieldName, fieldLabel, inForm, i
bulkEditSwitchChangeHandler(fieldName, newSwitchValue);
};
console.log("multiple? " + isMultiple);
const autocomplete = (
<Autocomplete
id={fieldName}