Skip to content

Transfer: Support asynchronous data search#12160

Open
Emiya0306 wants to merge 1 commit intoElemeFE:devfrom
Emiya0306:transfer#12157
Open

Transfer: Support asynchronous data search#12160
Emiya0306 wants to merge 1 commit intoElemeFE:devfrom
Emiya0306:transfer#12157

Conversation

@Emiya0306
Copy link
Copy Markdown

@Emiya0306 Emiya0306 commented Jul 30, 2018

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow Element's contributing guide (中文 | English | Español).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer relative issues for you PR.

ezgif-5-eb59ce7f1b

@Emiya0306 Emiya0306 changed the title #12157 [Feature Request] Support transfer box asynchronous data search Transfer: Support asynchronous data search Jul 30, 2018
@element-bot
Copy link
Copy Markdown
Member

element-bot commented Jul 30, 2018

Deploy preview for element ready!

Built with commit 54ae29b

https://deploy-preview-12160--element.netlify.com

@jikkai
Copy link
Copy Markdown
Contributor

jikkai commented Jul 30, 2018

要是方便的话可以补一下 en-US 和 es 的文档、 d.ts 相关定义以及测试用例

不过这个功能我们可能先要评估下 😓

@Emiya0306
Copy link
Copy Markdown
Author

好的

@ziyoung
Copy link
Copy Markdown
Contributor

ziyoung commented Jul 30, 2018

ref #12157
如果仅仅是过滤一些信息的话,就可以 filter-method 中处理了。不太明白这个钩子的用途。

@Emiya0306
Copy link
Copy Markdown
Author

Emiya0306 commented Jul 30, 2018

@ziyoung filter-method是个很棒的想法,我曾经也尝试过。不过这个需求点在于实现异步数据获取之后进行过滤。即在filter-input中输入的query作为依据,然后从后端获取数据,作为transfer的渲染数据,来进行过滤。

之前有尝试,由于filter-method是一个同步的方法。如果改造成支持异步,开发者要写很多负担性的代码,比如check当前item是不是第一个未选项,比如check当前输入的query等不等于上一次query(在filter-method修改transfer data会造成渲染死循环)等。

介于上面因素的考虑,我觉得增加一个before-query的属性会更有扩展性,开发者的操作空间也会更大。

@huanz
Copy link
Copy Markdown

huanz commented May 15, 2019

求Merge

  1. filter-method 无法修改数据
  2. data filter-method 不触发
  3. 左侧数据量可能会比较大的情况,可能需要用户输入关键词搜索出结果,然后再进行操作

@tng10
Copy link
Copy Markdown

tng10 commented May 17, 2019

@Emiya0306 @huanz I have the same issue here... Did you guys managed to find a workaround without this PR?

@ziyoung what do you think about this PR? Can you merge it?

@ziyoung
Copy link
Copy Markdown
Contributor

ziyoung commented Jul 31, 2019

@Emiya0306 先解决一下冲突。

@Emiya0306
Copy link
Copy Markdown
Author

Emiya0306 commented Feb 4, 2020

@ziyoung
Done. Sorry for long time no processing, please have a check.
I just add zh-cn and en-us document.

@stale
Copy link
Copy Markdown

stale bot commented Jun 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 16, 2021
@Emiya0306
Copy link
Copy Markdown
Author

@cs1707 Hey, can anyone check this PR?

@stale stale bot removed the stale label Jun 17, 2021
@cs1707 cs1707 self-requested a review June 17, 2021 02:48
@cs1707
Copy link
Copy Markdown
Contributor

cs1707 commented Jun 18, 2021

这边初步设想了一下,添加一个 search 事件,可能会是个更好的方式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants