Jeditable - onblur 错误:提交并单击文本框
我有一张表,您可以在其中输入您的时间。鼠标悬停似乎没有执行任何操作。单击、双击并聚焦即可。
我不仅可以使用 ENTER 进行提交,这就是 onblur: 提交的原因。 如果我使用任何单击或焦点,焦点之一是“文本”,然后是另一个“文本”(在单击其他位置之前),第二个“文本”将打开 - >关闭然后变得不可编辑。 请并谢谢您。 使用 Jeditable 1.4.3 当我注释掉 onblur:submit 时,我没有收到文本框错误。如果可能的话,我想使用鼠标悬停甚至鼠标移出来提交。
代码可以在这里找到...
I have a table where you input your hours. Mouseover doesn't appear to do anything. Click, dblclick and focus do.
I can not only have ENTER for submit, this is why onblur: submit.
If I use any click or focus , the focus one a "text" , then another "text" right after (before clicking else where) , the second "text" opens -> closes then becomes uneditable.
PLEASE and thank you.
Using Jeditable 1.4.3 When I comment out the onblur:submit, i do not get the text box error. I would like to use mouseover and even mouseout to submit if possible.
code can be found here...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:最后可能的解决方案
我想我明白你的意思,因为我遇到了同样的问题(并且还没有看到任何解决方案)。
如果我理解正确,问题是这样的:
如果您有一个表,其中每个单元格都通过 onblur: 'submit' 绑定到 jedtiable,您会期望当您单击一个单元格时,进行编辑,然后单击第一个单元格的另一个单元格单元格将提交,您将能够继续对第二个单元格进行编辑。然而,似乎发生的情况是,您单击第一个单元格,进行编辑,单击第二个单元格(模糊第一个单元格并导致第一个单元格提交),开始编辑第二个单元格,然后编辑第一个单元格提交第二个单元格接收模糊事件并提交并关闭。
您想要发生的是第一个单元格提交并关闭,但保持第二个单元格打开并编辑。我不确定为什么当第一个单元格提交时会出现模糊事件。
编辑
我找到了一个可能的解决方案,尽管它需要对 jeditable 进行修改。
如果您将 setTimeout 添加到 jeditable 中的代码块中,将焦点放在输入框上,则似乎可以解决该问题。
在 jeditable: 中找到这一行
并将其更改为:
这似乎可以做到这一点,但我希望有更好的方法。
EDIT: Possible solution at the end
I think I understand what you're getting at because I'm having the same issue (and haven't seen any solutions yet).
If I understand correctly, the problem is this:
If you have a table where each cell is bound to jedtiable with onblur: 'submit' you'd expect that when you click one cell, make an edit and then click another cell that the first cell would submit and you'd be able to continue making edits to the second cell. However, what seems to happen is that you click the first cell, make your edit, click the second cell (blurring the first cell and causing a submit on the first cell), begin editing the second cell and then as soon as the first cell submits the second cell receives a blur event and submits and closes.
What you want to happen is for the first cell to submit and close but leave the second cell open and editing. I'm not sure why it's getting a blur event when the first cell submits.
EDIT
I found a possible solution although it requires a hack of jeditable.
If you add a setTimeout to the code block in jeditable that puts focus on the input box it seems to fix the issue.
Find this line in jeditable:
and change it to:
That seems to do it but I'm hoping there's a better way.