Jeditable 无法与 Jquery 可排序一起使用
我使用 Jeditable(类型为 autogrow)来编辑具有类似兄弟姐妹的 div 中的文本。然后我对所有兄弟姐妹使用 Sortable,然后当单击外部时 jeditable 不会取消编辑。
真的很困难,因为我需要可排序的功能并且不想丢失编辑。
编辑: 另外,一旦我单击编辑文本,它就不允许我从文本区域选择任何文本。这真的变得更糟了。对于我臃肿的应用程序来说,可排序似乎太多了
I was using Jeditable(with type autogrow) for editing text within a div which has similar siblings. Then I used Sortable for all the siblings and then jeditable wont cancel edit when click outside.
Really in a pickle as I need sortable functionality and dont want to lose the editing.
Edit:
Also, once I click to edit a text, It will not allow me to select any text from the textarea. This is getting real worse. Sortable seems like too much for my bloated app
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我讨厌带回旧线程,但这是 Google 的最佳结果之一,而且没有解决方案。
由于我看不到代码,这只是一个猜测,但我遇到了同样的问题,这解决了它。
.disableSelection() 影响可排序的所有子项,并且您只希望它影响直接子项,就像可排序一样。只需将其更改为 .children().disableSelection();应该没问题。 :)
示例:
编辑:我在一个新项目上尝试了这一点,但它的工作方式与在另一个项目上的工作方式不同。但是,一起删除disableSelection()是可行的,而且我没有发现它弄乱了任何东西。
I hate bringing back an old thread, but this was one of the top results in Google and it had no solution.
Since I can't see the code, this is only a guess, but I had the same problem and this solved it.
.disableSelection() affects all children of the sortable, and you only want it to affect the direct children, just like sortable does. Just change it to .children().disableSelection(); and it should be fine. :)
Example:
Edit: I tried this out on a new project, and it didn't work the way it did on another. But, removing disableSelection() all together works, and I didn't find that it messed anything up.