在另一个字段上的输入字段的更改值在Strapi中的模糊事件
为此,我一直在为Strapi的文档挣扎。
有一系列文章。创建文章时,有2个字段,即开始日期和结束日期。现在,当启动日期的值更改和用户选择事件时,我想从此更新结束日期的值。
当然,价值的计算不是问题,但是我找不到任何东西来更新Blur事件的值。
现在,我正在使用 beforecreate 和 update lifecycle钩子,但是当用户单击保存按钮时,strapi doc中提到的所有这些钩子都在运行。
这可能会解决情况,但对于来自WordPress或任何其他自定义CMS的用户而言,这不是一个想法的情况
I've been struggling with the docs of strapi for this.
There's a collection of articles. When creating an article, there are 2 fields i.e Start Date and End Date. Now when a value of Start Date changes and user is done selecting an event, I want to update the value of End Date 6 months from that.
Ofcourse the calculations of value are not a problem but I'm unable to find anything to update the value on blur event.
Right now, I'm using beforeCreate and beforeUpdate lifecycle hooks but all these hooks mentioned in strapi doc run when a user clicks Save button.
This might solve the case but this is not an idea scenario for a user coming from Wordpress or any other custom CMS where this is easily doable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Strapi目前尚未提供任何模糊事件。我们已经在Strapi论坛上发布了评论,然后唯一的方法是使用Strapi提供的生命周期事件。请参阅此链接
https://forum.strapi.io/t/change-value-of-input-field-field-on-nother-fields-blur-event-instrapi/19829
Strapi is not providing any blur events for now . We have Posted Comments on the strapi forum untill then only way to fix this is by using life cycle events provided by strapi. Refer this link https://docs.strapi.io/developer-docs/latest/development/backend-customization/models.html#lifecycle-hooks
https://forum.strapi.io/t/change-value-of-input-field-on-another-fields-blur-event-in-strapi/19829