ExtJS3 虚拟键盘插件在 ExtJS4 中引发异常
我使用了可用的虚拟键盘插件此处< /a> 在 Ext JS 3 中:
它似乎不适用于 Ext JS 4 。我已经更改了 VirtualKeyboard.js 文件 &它看起来如下,问题是 BackSpace 给了我一个错误: Uncaught TypeError: Cannot read property 'length' of undefined
执行时抛出 dom.value.substr(0, dom.value.length - 1)
这里修改为 VirtualKeyboard.js : http://www.sencha.com/forum /showthread.php?147963-Extjs-4-virtual-keyboard-plugin
I had used virtual keyboard plugin available here in Ext JS 3 :
It does not seem to be working with Ext JS 4 . I have changed VirtualKeyboard.js file & it looks as follwing, problem is BackSpace gives me an error :
Uncaught TypeError: Cannot read property 'length' of undefined
Thrown while executing dom.value.substr(0, dom.value.length - 1)
Here is modified VirtualKeyboard.js :
http://www.sencha.com/forum/showthread.php?147963-Extjs-4-virtual-keyboard-plugin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无需在原始虚拟键盘文件中进行更改,而是使用 sencha 提供的 Ext JS 3 到 Ext JS 4 迁移包。这将允许您在 Ext JS 4 下运行 Ext 3 代码。您可以使用此包,直到虚拟键盘的原作者提供 ext js 4 的补丁。使用此包不会对 Ext JS 4 的性能产生巨大影响应用程序,因为增加了间接性。
您可以从此处下载迁移包。
干杯。
Instead of making changes in the original virtual keyboard file, use the sencha provided, Ext JS 3 to Ext JS 4 migration pack. This will allow the you to run Ext 3 code under Ext JS 4. You can use this pack until the original author of the virtual keyboard provides a patch for ext js 4. Using this pack does not have a drastic effect on the performance of the application because of the increased indirection.
You can download the migration pack from here.
Cheers.
要修复错误,请使用 Firebug 并调试
dom
变量的内容。看来您的keyboardTarget
变量的值错误,或者您需要修复您的值访问器,那么您应该选择el
并使用el.getValue 访问它()
(未经测试!)To fix you error use Firebug and debug the content of your
dom
variable. It seems that either yourkeyboardTarget
variable has a wrong value or you need to fix your value accessor then you should just select theel
and access it withel.getValue()
(untested!)