2012-05-29 2 views
0

몇 가지 유효성 검사가 필요한 양식에 대한 모델을 만들고 있습니다.Sencha의 데이터 유효성 확인

//Defining a data structure for the Work Item List 
Ext.define('InfoImage.model.configure.configModel', { 
    extend : 'Ext.data.Model', 

    config : { 
     //Defining the fields required in the Work Item List 
     fields : [ 'servname', 'port', 'protocol', 'username', 'password', 
       'domain', 'appconfig', 'apptitle', 
       'appconfig' ], 

     validations : [ 
     { 
      type : 'presence', 
      name : 'servname' 
     }, 
     { 
      type : 'presence', 
      name : 'port' 
     // matcher : /[0-9]{4}[A-Z]+/ 
     }, 
     { 
      type : 'presence', 
      name : 'username' 
     }, 
     { 
      type : 'presence', 
      name : 'password' 
     }], 
     proxy : { 
      type : 'localstorage', 
      id : 'configId' 
     } 
    } 
}); 

내가

Ext.getCmp('form').validate(); 

에 의해 검증을 호출 시도했지만 그것은 검증라는있는 방법이 없다는 것을 말한다 :

모델은 다음과 같습니다.

유효성 검사를위한 방법은 있습니까? 그렇다면 어떻게 할 수 있습니까?

답변

관련 문제