简体   繁体   English

通过extjs中的焦点文本字段打开窗口

[英]Open window via focus textfield in extjs

Good afternoon friends , I'm from Brazil and my English is not the best, so I'm using the google translator to be able to describe my problem, first of all I'm sorry the English mistakes. 下午好,我来自巴西,英语也不是最好的,所以我正在使用谷歌翻译器来描述我的问题,首先我很抱歉英语的错误。

I am new to extjs and I wonder how do you call a window that already have ready shortly after the User click the textfield , follows the code that is not working ... 我是extjs的新手,我想知道如何在用户单击文本字段后不久调用一个已经准备就绪的窗口,遵循无法正常工作的代码...

Ext.onReady(function() {

var titleEl = Ext.get("title-bar");
titleEl.update(i18n.rulesConf);
var form = new Ext.form.Form({
    labelWidth : 70,
    url : '../../evt/configprofile.do'
});

form.add(new Ext.form.TextField({
    name : 'meters',
    fieldLabel : i18n.name,
    width : 250,
    allowBlank : false

}), new Ext.form.Checkbox({
    name : 'enabled',
    fieldLabel : i18n.enabled

}), new Ext.form.TextField({
    name : 'meters',
    id : 'meters'
    fieldLabel : i18n.name,
    width : 250,
    allowBlank : false,

}));

Ext.get('meters').on('click', function() {
    dialog_meterSearching.show();
});

I put only an excerpt . 我只摘录了一部分。 I wish by clicking textfield meters open my window . 我希望通过单击文本框仪表打开我的窗口。

Could anyone help me? 有人可以帮我吗?

What is version of your ExtJS? 您的ExtJS是什么版本? If you only want to open a window when focus on the textfield , you can listen a focus event on your Textfield. 如果仅在焦点放在文本字段时只想打开一个窗口,则可以在文本字段上侦听focus事件。 Something like this: 像这样:

new Ext.form.TextField({
    name : 'meters',
    id : 'meters'
    fieldLabel : i18n.name,
    width : 250,
    allowBlank : false,
    listeners: {
        focus: function(comp){
            dialog_meterSearching.show();
        }
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM