From: Bill Erickson Date: Fri, 23 Mar 2012 16:04:02 +0000 (-0400) Subject: AutoGrid onItemReceived support X-Git-Tag: sprint4-merge-nov22~4390 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9f7d2416b370b1d87ddd4bfc7a731eb0d89abedb;p=working%2FEvergreen.git AutoGrid onItemReceived support Adds support for a new call-back, called when a grid row item is received (via pcrud onresponse). If defined, The call-back is passed the received item before the it's added to the data store. This allows users to get a direct handle on received objects. Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 715a7c02c9..e570d986ab 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -36,6 +36,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { requiredFields : null, hidePaginator : false, showLoadFilter : false, + onItemReceived : null, suppressLinkedFields : null, // list of fields whose linked display data should not be fetched from the server /* by default, don't show auto-generated (sequence) fields */ @@ -626,6 +627,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) { streaming : true, onresponse : function(r) { var item = openils.Util.readResponse(r); + if (self.onItemReceived) + self.onItemReceived(item); self.store.newItem(item.toStoreItem()); }, oncomplete : function() {