ExtJS 4:在工具栏中使用文本输入时出现问题(我认为是 focusmanager)

发布于 2024-11-17 06:49:23 字数 661 浏览 7 评论 0原文

我到处寻找,但找不到问题的答案,也许这里有人可以帮助我。

我有一个带有工具栏的面板 工具栏有 3 个项目(按钮、文本字段、按钮) 这工作正常,我可以按按钮,但无法在文本字段中写入、编辑等...

但是如果我更改为:按钮、组件、按钮 在组件中,我写了一个 html: ''

焦点管理器(也许是其他东西......)启动......好吧......文本输入不太好,我可以写......但我不能按退格键,如果我这样做,什么也不会发生,我也不能按箭头键......

有没有办法仅在该文本输入中抑制焦点管理器???或整个工具栏(我真的不需要它)

我尝试过“Ext.FocusManager.disable()”,但这不起作用(Ext.FocusManager.enabled也返回false......所以也许它是这并不是焦点管理器的错)

我已将问题范围缩小到工具栏...... 我在其他地方创建了一个文本输入,所有键都可以工作...我在工具栏中移动了相同的输入(使用jquery)...并且退格键和箭头键停止工作...如果我将其移出,键再次开始工作:S

我需要它作为文本输入,因为我计划使用 jQuery 插件来隐藏当前输入并将其替换为另一个输入...所以你看...即使我使用文本字段,文本字段将被隐藏,文本输入将替换它,而没有退格键和箭头键功能

任何帮助将不胜感激

问候!

I've been looking everywhere, but I can't find an answer to my problem maybe someone out here can help me.

I have a panel with a toolbar
The toolbar has 3 items (Button, Textfield, Button)
This works fine, I can press buttons, I can't write, edit, etc. in the Textfield...

But if I change to: Button, component, button
And in the component I write a html: ''

The focus manager (maybe something else...) kicks in ... well.. not really so good with that text input, I can write... but I can't press Backspace, if I do, nothing happens, nor I can press the arrow keys....

Is there a way to supress the focus manager only in that text input??? or to the whole toolbar (I don't really need it)

I've tried the "Ext.FocusManager.disable()" but that doesn't work (also the Ext.FocusManager.enabled returns false... so maybe it's not really fault of the Focus Manager)

I've narrowed down the problem to the toolbar...
I created a Text Input some place else, and all the keys work... I moved that same input (using jquery) inside the toolbar... and the backspace and arrow keys stop working... if I move it out, the keys start working again :S

I need it to be a text input because I'm planning on using a jQuery plugin which hides the current input and replaces it with another input... so you see... even if I use textfield, the textfield will get hidden and a text input will replace it without backspace and arrow keys functionality

Any help will be greatly appreciated

Regards!!!!!!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉睡月亮 2024-11-24 06:49:23

好吧......

使用 xtype: 'textfield' 对我来说有些奇怪......
Ext.FocusManager.启用
返回 false...

如果我执行 Ext.FocusManager.enable();之后是 Ext.FocusManager.disable();
即使 xtype: 'textfield' 也停止使用退格键和箭头键:O

所以我猜 FocusManager 有事情要做....

无论如何,我暂时解决了我的问题 :P

我将组件保留为文本字段

        {
            xtype: 'textfield',
            name: 'emailsi',
            id: 'emailsi',
            labelStyle: 'width: auto',
            labelWidth: 120,
            width: 500,
            fieldLabel: idioma.personasInvolucradas
        }

当文本输入得到时通过 jquery 创建,它将 display: none 应用于前一个文本字段
所以...我恢复了 display:block 并应用了 position:absolute;浮动:右; z-index: -1; 所以它再次隐藏并且不会干扰布局:P

最后,为了恢复退格键和左/右箭头键功能........

我创建了一个jQuery 中的 .focus() 事件,如下所示:

                $('.textboxlist-bit-editable-input').focus(function(){
                    $('#emailsi>div>input').css({display: 'block', 'z-index': '-2', position: 'absolute', float: 'right'});
                    Ext.getCmp('emailsi').focus();
                });

基本上,我发现只要原始文本字段具有焦点,我就可以在文本输入中按退格键:)(也是我应用css的事情,首先是焦点事件之外,但是当工具栏重新绘制,文本字段返回显示:无)

如果有人有更好的解决方案,我们将非常欢迎:D

问候!

ok....

Using the xtype: 'textfield' there was something odd for me....
Ext.FocusManager.enabled
returns false....

If I do a Ext.FocusManager.enable(); and after that a Ext.FocusManager.disable();
Even the xtype: 'textfield' stops working with the backspace and arrow keys :O

So I guess FocusManager has something to do....

anyway, I provisionally solved my issue :P

I left the component as textfield

        {
            xtype: 'textfield',
            name: 'emailsi',
            id: 'emailsi',
            labelStyle: 'width: auto',
            labelWidth: 120,
            width: 500,
            fieldLabel: idioma.personasInvolucradas
        }

And when the text input gets created via jquery it applies display: none to the previous textfield
So... I restore the display:block and also apply a position: absolute; float: right; z-index: -1; so it gets hidden again and doesn't disturb the layout :P

And finally, to restore the Backspace and Left/Right Arrow Keys functionality........

I create a .focus() event in jQuery, like this:

                $('.textboxlist-bit-editable-input').focus(function(){
                    $('#emailsi>div>input').css({display: 'block', 'z-index': '-2', position: 'absolute', float: 'right'});
                    Ext.getCmp('emailsi').focus();
                });

Basically, I discovered that as long as the original textfield has the focus, I can press backspace in the text input :) (also there's where I apply the css thing, first it was outside the focus event, but when the toolbar gets repainted, the textfield goes back to display:none)

If someone has a better solution, it will be very welcomed :D

Regards!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文