Skip to content

Commit

Permalink
When the last batch of related objects is being displayed and the sol…
Browse files Browse the repository at this point in the history
…e object in that batch is removed, set the new last batch as the DG's current batch.
  • Loading branch information
fbarthez authored and darkv committed Apr 19, 2016
1 parent 9f4c39c commit f04e5d2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ public void relatedObjectDidChange(NSNotification notif) {
EOEnterpriseObject obj = (EOEnterpriseObject)userInfo.valueForKey("object");
if (relationshipKey() != null && relationshipKey().equals(key) && ERXEOControlUtilities.eoEquals(masterObject(), obj)) {
relationshipDisplayGroup().fetch();
// when the last object of the last batch gets removed, select the new last batch
if (relationshipDisplayGroup().currentBatchIndex() > relationshipDisplayGroup().batchCount()) {
relationshipDisplayGroup().setCurrentBatchIndex(relationshipDisplayGroup().batchCount());
}
}
}
if (notif.userInfo().valueForKey("ajaxNotificationCenterId") == null) {
Expand Down

0 comments on commit f04e5d2

Please sign in to comment.