amisadmin / fastapi-amis-admin

FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.
http://docs.amis.work
Apache License 2.0
1.05k stars 154 forks source link

The filter on input-group does not work #169

Open SergShulga opened 5 months ago

SergShulga commented 5 months ago

I have the following field configuration in a model:

store_min_cost: float = Field(
        default=0.0, nullable=True, title="КЛ ₽(м2) min",
        amis_table_column={'type': "number", 'kilobitSeparator': True, 'sortable': True},
        amis_filter_item=
        {
            "type": "input-group",
            "description": "по умолчанию указан предельный диапазон",
            "validationConfig": {"errorMode": "partial"},
            "body": [
                {
                    "type": "input-text",
                    "size": "sm",
                    "source": "/get_filter_range/?mark=min&model=ComplexBase&field=store_min_cost",
                    "name": "s_min",
                    "autoComplete": False,
                    "validations": {"isNumeric": True, "maximum": "${s_max}"},
                    "validationErrors": {
                        "isNumeric": "Допустимо только числовое значение",
                        "maximum": "Не может превышать правое значение",
                    },
                },
                {
                    "type": "input-text",
                    "size": "sm",
                    "source": "/get_filter_range/?mark=max&model=ComplexBase&field=store_min_cost",
                    "name": "s_max",
                    "autoComplete": False,
                    "validations": {"isNumeric": True, "minimum": "${s_min}"},
                    "validationErrors": {
                        "isNumeric": "Допустимо только числовое значение",
                        "minimum": "Не может быть ниже левого значения",
                    },
                },
            ]
        }
    )

This grouping is necessary to set min\max values. I take the data for the limits from the API (that’s why I can’t use input-range - there is no way to dynamically specify the limit based on data from the database).

I see everything in the filter, 2

but the search does not react in any way to changing values. And when debugging, I see that the value from the form is not forwarded.

1

Any advice is welcome!