使用 jeditable 和 autogrow 的问题
我使用 jQuery 和 CakePHP 开发一个 Web 项目。 我使用 jeditable 作为就地编辑插件。 对于文本区域,我使用 autogrow 插件 扩展它。
嗯,我对此有两个问题:
- 首先,自动增长仅适用于 Firefox,不适用于 IE、Safari、Opera 和 Chrome。
- 其次,我需要 jeditable 的回调事件,当它完成显示编辑组件时,重新计算 scrollbar
我对Javascript不太熟悉,所以我无法自己扩展/更正这两个库。 有没有人使用另一个js库进行自动增长文本区域的就地编辑(没有像TinyMCE这样的完整编辑器,我需要纯文本的解决方案)?
我还发现 Growfield,它适用于其他浏览器,但没有可编辑的集成...
(对不起我的英语)
I work on a Webproject using jQuery and CakePHP. I use jeditable as an inplace edit plugin. For textareas I extend it using the autogrow plugin.
Well, I have two problems with this:
- First, autogrow does only work on Firefox, not on IE, Safari, Opera and Chrome.
- Second, I need a callback event for jeditable, when its finished showing the edit-component, to recalculate the scrollbar
Im not so familiar with Javascript, so i can't extend/correct this two libraries by my own. Has anyone used another js-library for inplace edit with auto growing textareas (no complete editors like TinyMCE, I need a solution for plain text)?
I also found Growfield, it would work for other browsers, but there's no jeditable integration...
(sorry for my english)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在任何浏览器中使用 Autogrow 和 jeditable 都没有发现任何问题,但这里是 Growfield 和 jeditable 的实现。 它的工作方式与 jeditable 的 Autogrow 插件非常相似。 您为 jeditable 创建一个特殊的输入类型,然后将 .growfield() 应用于它。 必要的 JavaScript 如下,演示可以在这里 。
I didn't see any problems using Autogrow with jeditable in any browsers but here is an implementation of Growfield with jeditable. It works much in the same way that the Autogrow plugin for jeditable does. You create a special input type for jeditable and just apply .growfield() to it. The necessary javascript is below, a demo can be found here.
knight_killer:自动增长仅适用于 FireFox,这是什么意思? 我刚刚使用 FF3、FF2、Safari、IE7 和 Chrome 进行了测试。 与所有这些都工作得很好。 我没有可用的 Opera。
Alex:有 Growfield Jeditable 自定义输入的下载链接吗? 我想从我的博客链接它。 真是太棒了!
knight_killer: What do you mean Autogrow works only with FireFox? I just tested with FF3, FF2, Safari, IE7 and Chrome. Works fine with all of them. I did not have Opera available.
Alex: Is there a download link for your Growfield Jeditable custom input? I would like to link it from my blog. It is really great!
Mika Tuupola:如果你对我修改后的jeditable(添加了两个回调事件)感兴趣,你可以在这里获取。 如果您能在 jeditable 的官方版本中提供这些事件,那就太好了!
这是我的(简化的)集成代码。 我使用这些事件的目的不仅仅是为了悬停效果。 这只是一个用例。
Mika Tuupola: If you are Interested in my modified jeditable (added two callback events), you can get it here. It would be great if you would provide these events in your official version of jeditable!
Here is my (simplified) integration code. I use the events for more then just for the hover effect. It's just one usecase.
谢谢亚历克斯!你的growfield插件可以工作。
与此同时,我设法解决了另一个问题。 我使用了另一个 Scroll-Library 并将回调事件侵入 jeditable-plugin 。 这并没有我想象的那么难...
Thank you Alex! Your growfield-Plugin works.
In meantime I managed to solve the other problem. I took another Scroll-Library and hacked a callback event into the jeditable-plugin. It was not that hard as I thought...