0

How to dynamically update summary feature for grid in extjs4.1?

In my application the grid summary will become filled at the time of loading the page, the grid by calculating a total using the summary feature. I have a combo box drop down in the screen. If a user selects from the combo box, I need to update the grid records from store and also need to update the calculated summary value using records coming from another store.

Can anybody tell me how to do that? Thanks

Christoph
  • 1,023
  • 11
  • 23
mohan
  • 13,035
  • 29
  • 108
  • 178

1 Answers1

0

Assuming that yourGridItemId is the first/only grid with this itemId, the following code should work:

Ext.ComponentQuery.query('#yourGridItemId')[0].getView().refresh();
Guilherme Lopes
  • 4,688
  • 1
  • 19
  • 42
  • There is anything wrong if it not happens automatically. I would rather look for the source of error then to apply a hack... – sra Jun 20 '13 at 10:00
  • The summary update automatically on store.load()... if you add, delete, update a row it won't refresh the summary. That is the standard behavior. But doing automatically is a nice feature request. :) – Guilherme Lopes Jun 20 '13 at 19:52
  • I never tested it but if so it is a bug. Because the summary register events for update & datachanged as you can see in my edit. So if the record is edited the correct way the store will get notified which then notify the grid and in the same way the summary – sra Jun 21 '13 at 06:27
  • It would work automatically if you sync the data to the store. But normally I don't want to sync it until the last minute so getting a real time update with the new (dirty) records is only possible updating the View. – Guilherme Lopes Jun 21 '13 at 18:57