Skip to content

Commit 554d4dc

Browse files
committed
ui: refresh addressbook grid after contact edits
When a contact or distribution list is opened from the addressbook dialog and then modified, the changes were not reflected in the grid because the addressbook store is separate from the ShadowStore where the edits are saved. Listen for write events on the ShadowStore and reload the current grid view so updated attributes are visible immediately.
1 parent 278bcd5 commit 554d4dc

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

client/zarafa/addressbook/ui/AddressBookMainPanel.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ Zarafa.addressbook.ui.AddressBookMainPanel = Ext.extend(Ext.Panel, {
9595
// Load the address book
9696
this.initDialog();
9797

98+
// When a contact or distlist is saved from a sub-dialog opened via
99+
// the AB, reload the grid to reflect the changes.
100+
this.mon(container.getShadowStore(), 'write', this.onShadowStoreWrite, this);
101+
98102
// When shared stores are added/removed in the hierarchy, keep the
99103
// AB hierarchy dropdown in sync.
100104
this.hierarchyStore = container.getHierarchyStore();
@@ -182,6 +186,17 @@ Zarafa.addressbook.ui.AddressBookMainPanel = Ext.extend(Ext.Panel, {
182186
}
183187
},
184188

189+
/**
190+
* Called when a record is saved via the ShadowStore (e.g. the user edited
191+
* a contact or distribution list opened from this dialog). Reloads the
192+
* grid to reflect the changes.
193+
* @private
194+
*/
195+
onShadowStoreWrite: function()
196+
{
197+
this.onSearchButtonClick();
198+
},
199+
185200
/**
186201
* Cleanup handler when the panel is destroyed. Removes hierarchy store
187202
* listeners and destroys the address book store.

0 commit comments

Comments
 (0)