1

I have a view: Main.js I have a viewModel: MainModel.js

Within the MainModel.js file:

    Ext.define('SGSS.view.main.MainModel', {
        extend: 'Ext.app.ViewModel',
        alias: 'viewmodel.main',
        listeners: {
            afterrender: function() {
                /* What is to be put in here? */
            }
        }, 
    /*.... And so on ....*/

I'm hoping that I can have the data that is being put into the MainModel.js file be continually refreshed, as it has information that is being sent to it on a continual basis to read. I don't want the end user to keep hitting "refresh" if they want the most up to date information on this "dashboard". We'll say as an example, there's a thermometer and a barometer that has to be continually read. What do I need to do in order to get this listener to keep reloading the view to get the most information?

EDIT: I'm not entirely sure if I've made this clear, previously. It's not that the Model and ModelView are not bound to one another. That's doing well. I'm saying that there's a JSON object out there that has continually updated data whenever it is called. So the idea here is to have the ModelView constantly updating itself by calling the JSON object. Can this be done?

Vinnie Saletto
  • 329
  • 2
  • 5
  • 20

1 Answers1

0

ExtJS documentation has explained this nicely. Please look this page: https://docs.sencha.com/extjs/6.0/application_architecture/view_models_data_binding.html

MAP
  • 34
  • 3
  • I'm not entirely sure if I've made this clear, previously. It's not that the Model and ModelView are not bound to one another. That's doing well. I'm saying that there's a JSON object out there that has continually updated data whenever it is called. So the idea here is to have the ModelView constantly updating itself by calling the JSON object. Can this be done? – Vinnie Saletto Jun 15 '16 at 20:57
  • You might be looking for similar solution: http://stackoverflow.com/questions/5952542/track-whether-object-changed – MAP Jun 27 '16 at 17:04