javascript - extJS: set 'config options' on field by JS -


why can't set 'config options' methode set

set({value: 'new value',disabled:true}); 

how can set 'properties' field

var name = {     fieldlabel:'name',     value: 'test',     id:'id-name',     xtype: 'textfield', }; this.form= new ext.formpanel({     items:[name],     buttons: [{         text   : 'set value',         handler: function() {             ext.getcmp('id-name').set({value: 'new value',disabled:true});         }] }); 

resetting component properties using object not part of design of extjs. config used in object creation , when first used in constructor applied object using special methods extjs class system core generate getters , setters , initialize component them. not possible trying , desired result. in example above, textfield initialized config overriding default values of component during creation , generates getters , setters attributes, value, id, , fieldlabel need used instead of config objects after component created. make example work, need this:

var name = {     fieldlabel:'name',     value: 'test',     id:'id-name',     xtype: 'textfield', }; this.form= new ext.formpanel({     items:[name],     buttons: [{         text   : 'set value',         handler: function() {             var mytextfield = ext.getcmp('id-name');             mytextfield.setvalue('new value');             mytextfield.setdisabled(true);         }] }); 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -