From 178fa3403170cf90f78cd36445e7f26eec86fec7 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 28 Apr 2014 23:11:58 +0000 Subject: [PATCH] Implement action system state for trees --- phpgwapi/js/egw_action/egw_dragdrop_dhtmlx_tree.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpgwapi/js/egw_action/egw_dragdrop_dhtmlx_tree.js b/phpgwapi/js/egw_action/egw_dragdrop_dhtmlx_tree.js index a54e958c2e..2c2b86ae47 100644 --- a/phpgwapi/js/egw_action/egw_dragdrop_dhtmlx_tree.js +++ b/phpgwapi/js/egw_action/egw_dragdrop_dhtmlx_tree.js @@ -53,6 +53,20 @@ function dhtmlxtreeItemAOI(_tree, _itemId) } } + aoi.doSetState = function(_state) { + if(!_tree || !_tree.focusItem) return; + + // Update the "focused" flag + if(egwBitIsSet(_state, EGW_AO_STATE_FOCUSED)) + { + _tree.focusItem(this.id); + } + if(egwBitIsSet(_state, EGW_AO_STATE_SELECTED)) + { + _tree.selectItem(this.id, false); // false = do not trigger onSelect + } + } + return aoi; }