From 8cd05c571bd6183ba8261535b02e23b2dc43c77a Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 25 Aug 2020 14:01:31 -0600 Subject: [PATCH] Add debug function to log selected nextmatch internals Example usage: etemplate2.getByApplication('addressbook')[0].widgetContainer.getDOMWidgetById('nm').spillYourGuts() --- api/js/etemplate/et2_extension_nextmatch.ts | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 72c3d564c4..a77c529ffe 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -963,6 +963,36 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 return {ids:[],all:false}; } + /** + * Log some debug information about internal values + */ + spillYourGuts() + { + let guts = function(controller) + { + console.log("Controller:",controller); + console.log("Controller indexMap:", controller._indexMap); + console.log("Grid:", controller._grid); + console.log("Selection Manager:", controller._selectionMgr); + console.log("Selection registered rows:", controller._selectionMgr._registeredRows); + if(controller && controller._children.length > 0) + { + console.groupCollapsed("Sub-grids"); + let child_index = 0; + for(let child of controller._children) + { + console.groupCollapsed("Child " + (++child_index)); + guts(child); + console.groupEnd(); + } + console.groupEnd() + } + } + console.group("Nextmatch internals"); + guts(this.controller); + console.groupEnd(); + } + /** * Event handler for when the selection changes *