[eGroupWare-svn] r55982 - /branches/14.2/phpgwapi/js/egw_action/egw_action_popup.js

[email protected] Mon, 02 May 2016 19:45:33 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: nathangray
Date: Mon May  2 21:45:33 2016
New Revision: 55982

URL: http://svn.stylite.de/viewvc/egroupware?rev=55982&view=rev
Log:
Allow popup menu checkboxes to be toggled base on selected entry data

Modified:
    branches/14.2/phpgwapi/js/egw_action/egw_action_popup.js

Modified: branches/14.2/phpgwapi/js/egw_action/egw_action_popup.js
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/phpgwapi/js/egw_action/egw_action_popup.js?rev=55982&r1=55981&r2=55982&view=diff
==============================================================================
--- branches/14.2/phpgwapi/js/egw_action/egw_action_popup.js (original)
+++ branches/14.2/phpgwapi/js/egw_action/egw_action_popup.js Mon May  2 21:45:33 2016
@@ -60,7 +60,15 @@
 	action.set_checked = function(_value) {
 		action.checked = _value;
 	};
-
+	
+	// Allow checkbox to be set from context using the given function
+	action.set_isChecked = function(_value) {
+		action.isChecked = new egwFnct(this, null, []);
+		if(_value !== null)
+		{
+			action.isChecked.setValue(_value);
+		}
+	};
 	// If radioGroup is >0 and the element is a checkbox, radioGroup specifies
 	// the group of radio buttons this one belongs to
 	action.set_radioGroup = function(_value) {
@@ -494,6 +502,10 @@
 						item.set_hint(link.actionObj.hint);
 						item.set_checkbox(link.actionObj.checkbox);
 						item.set_checked(link.actionObj.checked);
+						if(link.actionObj.checkbox && link.actionObj.isChecked)
+						{
+							item.set_checked(link.actionObj.isChecked.exec(link.actionObj, _selected));
+						}
 						item.set_groupIndex(link.actionObj.radioGroup);
 
 						if (link.actionObj.shortcut)


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z