Sunday, 15 April 2012

extjs - Call validator method in ViewController from the View -


I am learning Ext JS 5.1.
Is it possible to call a validator method, which is defined by view controller as visual?

MyView

  {xtype: 'textfield', margin: '0 10 0', field label: 'password', name: 'pass1', reference: 'pass1 ', Type input:' password ', allow box: wrong, minaltai: 5}, {xtype:' textfield ', margin:' 0 10 0 ', field label:' confirm password ', name:' pass2 ',' Pass2  

MyViewController

 , input type: 'password', allowBlank: incorrect, verifier: 'check password' // method ViewController} check password that you want to call: function (value) {var pass1val = this.lookupReference ('pass1'). GetValue (); If (value == pass1val) {return true; } Else {return "The initial password and the typed password did not match."; My current work for V5.1 is the following (example):   

class = "post-text" itemprop = "text"> < P>

// ... ViewController init: function () {var startCombo = this.lookupReference ('startCombo'); Var endCombo = this.lookupReference ('endCombo'); StartCombo.validator = Ext.bind (this.comboValidator, this, [startCombo, endCombo]); EndCombo.validator = Ext.bind (this.comboValidator, this, [startCombo, endCombo]); }, ComboValidator: function (startCombo, endCombo) {return startCombo.getValue () & lt; EndCombo.getValue (); },

No comments:

Post a Comment