viewmodel - extjs 5 : make a data binding for component's custom property -
I have a file that extends from the file field, and I have added a custom property 'server path' to it, and I have Also define recipient and setter.
Code:
Ext.define ('MyApp.ux.Field.File', {extension: 'Ext.form.field.File', Xtype: 'myfilefield ', Serverpath:' ', getServerPath: function () {this.serverPath;}, setServerPath: function (serverPath) {this.serverPath = serverPath;}}); Ext.create ('MyApp.ux.Field.File', {bind: {serverPath: '{serverpath}'}, see Modell: {type: 'myViewModel'}}); I will not paste the definition of my view model. It is simple.
And it turns out that the binding does not take effect.
Can anyone help?
should be your class:
Ext.define ('MyApp .ux.Field.File ', {extension:' ext.form.file.file ', xtype:' myfilefield ', config: {serverPath:' '}}); And you should have all the sets because EXJGs will also make setters and gaets for you and setter. In your Idea Model, make sure you have one:
Data: {serverPath: 'yourPathGoesHere'} Edit There were two things that were missing: - When a value change changes on the visual model, the asynchronous is published by the scheduler. If you want to reflect changes immidiatically, then you need to use the notification on ViewModel or you will have to leave the argument after some changes.
- To get the custom config properties of a class, please refer to it to notify ViewModel of the required changes in the 'Publish' property of the property, please see it.
Comments
Post a Comment