From 7f684d9c815649072130c754e48b3157092f395f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 23 Mar 2012 12:04:02 -0400 Subject: [PATCH] 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 --- Open-ILS/web/js/dojo/openils/widget/AutoGrid.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js index 9210b367b1..b94f8c35d5 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js @@ -35,6 +35,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 */ @@ -612,6 +613,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() { -- 2.11.0