2012-12-01 2 views
2

경고 ok 단추를 누르면 extjs의 숫자 필드에 포커스를 설정하고 싶지만이 시스템을 사용해보십시오. 여기에 내 코드알림 확인 단추를 눌렀을 때 extjs의 양식 필드에 포커스 설정

Ext.Msg.alert("Invoice",'Invoice Id &nbsp'+invno + '&nbsp is not Available'); 
         Ext.getCmp('InvoiceNo').focus(true); 

하고 내 번호 필드는

{ 
     xtype    : 'numberfield',     
     hideTrigger  : true, 
     decimalPrecision : 0, 
     keyNavEnabled  : false, 
     mouseWheelEnabled : false, 
     fieldLabel  : 'InvoiceNo', 
     id    : 'InvoiceNo', 
     name    : 'InvoiceNo', 
     enableKeyEvents : true,       
     //minValue   : 1, 
     msgDisplay  : 'tooltip', 
     anchor   : '95%', 
     } 

답변

3

나는이 과정에 의해 그것을 할 수있다.

var v = Ext.getCmp('InvoiceNo').getValue(); 
Ext.Msg.confirm('InvoiceNo','InvoiceNo'+v , function (button) { 
    var InvoiceNo = Ext.getCmp('InvoiceNo'); 
    if (button == 'yes') { 
     setTimeout(function(){ 
      InvoiceNo.setValue(v); 
      InvoiceNo.focus(true)[0]; 
     },100);        
    }         
}, this); 
관련 문제