Skip to content

Instantly share code, notes, and snippets.

@stoeffel
Last active August 29, 2015 14:02
Show Gist options
  • Save stoeffel/093df00e13395db28b81 to your computer and use it in GitHub Desktop.
Save stoeffel/093df00e13395db28b81 to your computer and use it in GitHub Desktop.
extjs5 bind emptytext (ViewModel)
// 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'
}
/* ... */
@stoeffel
Copy link
Author

stoeffel commented Dec 5, 2014

hi sorry i didn't see your comment. can you send me an example where it doesn't work. it works for me.

@stoeffel
Copy link
Author

stoeffel commented Dec 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment