Last active
August 29, 2015 14:02
-
-
Save stoeffel/093df00e13395db28b81 to your computer and use it in GitHub Desktop.
extjs5 bind emptytext (ViewModel)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bind needs a getter to update the property. | |
// emptytext has no setter. So you need to create one | |
Ext.define('Override.Textfield', { | |
override: 'Ext.form.field.Text', | |
setEmptyText: function(emptyText) { | |
this.emptyText = emptyText; | |
this.applyEmptyText(); | |
} | |
}); | |
// Your VIEW | |
/* ... */ | |
xtype: 'textfield', | |
bind: { | |
emptyText: '{emptyText}' | |
} | |
/* ... */ | |
// Your VIEWMODEL | |
/* ... */ | |
extend: 'Ext.app.ViewModel', | |
data: { | |
emptyText: 'LOREM' | |
} | |
/* ... */ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi sorry i didn't see your comment. can you send me an example where it doesn't work. it works for me.