amis icon indicating copy to clipboard operation
amis copied to clipboard

表头的单选过滤器filterable动态绑定

Open rudyxu1102 opened this issue 7 years ago • 9 comments

image

如果filterable设置source属性的话,会请求很多遍,而且会报错 TypeError: adaptor is not a function

如果在外层套一层service的话,数据也获取不了。

ps:文档没有对于filterable的描述

rudyxu1102 avatar Aug 27 '19 03:08 rudyxu1102

这种可以给filterable的source上配置cache:3000 // 3秒加缓存时间

RickCole21 avatar Aug 27 '19 06:08 RickCole21

@RickCole21 谢谢,那这里adaptor用不了吗

rudyxu1102 avatar Aug 27 '19 06:08 rudyxu1102

可以啊,你咋配的

RickCole21 avatar Aug 27 '19 06:08 RickCole21

{
        "type": "crud",
        "api": "https://houtai.baidu.com/api/sample?waitSeconds=1",
        "footerToolbar": [
            "statistics",
            "switch-per-page",
            "pagination"
        ],
        "columns": [
            {
                "name": "browser",
                "label": "Browser",
                "sortable": true,
                "type": "text",
                "toggled": false
            },
            {
                "name": "version",
                "label": "Engine version",
                "quickEdit": true,
                "type": "text",
                "toggled": true,
                "filterable": {
                    "source": {
                        "url": "https://www.easy-mock.com/mock/5d5b6ef1af8d4d1bca47e65d/check/get_list",
                        "method": "get",
                        "cache": "3000",
                        "adaptor": "console.log(payload, 111); return payload"
                    }
                }
            }
        ]
    }

rudyxu1102 avatar Aug 27 '19 06:08 rudyxu1102

有bug,我处理下

RickCole21 avatar Aug 27 '19 06:08 RickCole21

已修复 #205 ,等待发正式版哈

RickCole21 avatar Aug 27 '19 07:08 RickCole21

@RickCole21 嗯嗯看到了,谢谢。不过我设置了cache也没有用,请求了很多遍。

rudyxu1102 avatar Aug 27 '19 08:08 rudyxu1102

用number

RickCole21 avatar Aug 27 '19 08:08 RickCole21

谢谢

rudyxu1102 avatar Aug 27 '19 08:08 rudyxu1102