Set focus on Extjs textfield

后端 未结 11 1811
星月不相逢
星月不相逢 2020-12-31 02:02

Currently I got problem with setting focus on extjs textfield. When form show, I want to set focus to First name text box and I try to use build in function focus() but stil

11条回答
  •  孤独总比滥情好
    2020-12-31 02:06

    I have also been struggling with getting the focus on a text box in the Internet Explorer(As the above suggestions are working fine in chrome and Firefox). Tried the solutions suggested above on this page but none of them worked in IE. After so many research I got the workaround that worked for me, I hope it will be helpful to others as well:

    Use focus(true) or if you want to delay this then use focus(true, 200) simply. In ref of the above problem the code would be:

      {
            fieldLabel: 'First Name',
            name: 'first',
            id: 'first_name',
            allowBlank: false,
            listeners: {
              afterrender: function(field) {
                field.focus(true);
              }
            }
        }
    

提交回复
热议问题