I've tried umpteen number of ways to do this, but it would seem you can't get a list to refresh once the data has been updated. It works automatically when binding the list to a store, but not when the "fields" and "data" properties are defined, i.e.:
myRefresh(): function () {
var data = this.getMainlist().getData();
data[0].val = '555'; // <-- some arbitrary value
this.getMainlist().setData(data)
this.getMainlist().initComponent();
this.getMainlistView().refresh();
}
... not to mention all kinds of other ways. The 'data' property of the list has indeed been changed (as I can see in my debugger), but the new data doesn't show up on the view/list.
Note: I don't want to set up a separate store just for the list items (to bind to). Tried it. That seemed to introduce a whole host of problems I don't even want to get into (e.g. store arbitrarily getting deleted). I just want to keep this simple and all inline/in-code, and using refresh() or some other event.
Has anybody done this? Has anybody solved this? Do I have to do some jQuery/DOM manipulation (which I would rather avoid)?
I've tried the XTemplate 'overwrite' method, but that didn't seem to do anything. Maybe I don't have the right 'el' (element) as the first parm, or maybe I have to do some special kind of re-display of the list/panel, I don't know. If someone has successfully done this, walk me through the exact steps. Thanks.
Hi,
once you created the list you do have a list.
Ext.Viewport.down('.list').getStore()
Within that you might be able to change the records: getStore().findRecord('text', 'Property2').set('text','PropertyX') This should automatically update your list.