Author: nick
Date: 2007-07-05 15:00:08 -0400 (Thu, 05 Jul 2007)
New Revision: 7002
Modified:
opencore/branches/octopus/opencore/nui/javascripts/oc-behaviors.js
Log:
edits to oc-behaviors
Modified: opencore/branches/octopus/opencore/nui/javascripts/oc-behaviors.js
===================================================================
--- opencore/branches/octopus/opencore/nui/javascripts/oc-behaviors.js
2007-07-05 18:54:24 UTC (rev 7001)
+++ opencore/branches/octopus/opencore/nui/javascripts/oc-behaviors.js
2007-07-05 19:00:08 UTC (rev 7002)
@@ -302,7 +302,46 @@
#
*/
OC.ActionSelect = function(extEl) {
+ // get refs
+ select = extEl;
+ form = select.up('form');
+
+ //check refs
+ if (!select) {
+ OC.debug("ActionSelect: Couldn't get refs");
+ return;
+ } else {
+ OC.debug("ActionSelect: Got Refs");
+ }
+
+ //settings
+ var action = form.dom.action;
+ OC.debug("form action: " + action);
+ function _doAction(e, el, o) {
+ YAHOO.util.Event.stopEvent(e);
+
+
+ // insert a hidden 'task' input into the form
+ var submit = document.createElement('input');
+ submit.name = "task";
+ submit.value = el.id;
+ OC.debug("task info: " + el.id);
+ submit.type = "hidden";
+ form.dom.appendChild(submit);
+
+ YAHOO.util.Connect.setForm(liveForm.dom);
+ var cObj = YAHOO.util.Connect.asyncRequest("POST", action,
+ { success: OC.Callbacks.afterAjaxSuccess,
+ failure: OC.Callbacks.afterAjaxFailure,
+ scope: this
+ },
+ "mode=async"
+ );
+
+ submit.parentNode.removeChild(submit);
+ }
+ actionSelects.on('change', _doAction, this);
}
/*
--
Archive:
http://www.openplans.org/projects/opencore/lists/openplans-svn/archive/2007/07/1183662009249
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]
Please contact [EMAIL PROTECTED] for questions.