New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table: add method resetFilter which can reset filter of a column #13176
Conversation
Deploy preview for element ready! Built with commit bd71490 |
@elfman 我觉得 clearFilter 应该类似于 Form 组件的 clearValidate 方法。该方法支持参数,参数可以是字符串或者一个数组。 大佬再稍微调增一下代码吧。😂 |
@ziyoung 改为通过修改clearFilter来实现重置指定列的过滤器了,可以传入单个columnKey或由columnKey组成的数组,不传参时重置全部列 |
@elfman 有这么几个问题呀。
this.$refs.table.clearFilter(['el-table_1_column_4']) utils 中 getColumnByKey 方法有些小问题。
|
@ziyoung 你搞反了吧,columnKey是用户定义的,columnId才是组件生成的,所以我才用columnKey而不是columnId,你上面调用时传入的是columnId啊。 |
@ziyoung 已经将 |
<el-table | ||
ref="filterTable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也需要在例子中 script 部分添加 resetDateFilter 方法的。不然 jsffdle 上运行例子会出问题。
@elfman 文档再更新一下,补充个西班牙文档就可以合并了(不用翻译西班牙语)。 |
@ziyoung 我在我自己的电脑上运行时没出现这几个问题啊。倒是一直会固定出现下面的错误,重置到
|
@elfman 等下个版本时把依赖全更新一下就差不多了。有些测试用例经常出问题。🙈代码可以合并了。 话说 table 的属性也真是够多的,理清这么多属性都得花上一段时间。😂 |
添加
resetFilter
方法,可以重置单列的filter