Skip to content
Browse files

Fill in the details about adding a new option on the client side

  • Loading branch information...
1 parent 74a0137 commit 9cfbcd125ca5634f5aa65bdaee54d80e42e04c4c @hlship committed Mar 25, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx-multiselect.js
View
23 tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx-multiselect.js
@@ -166,10 +166,33 @@ Tapx.extendInitializer(function() {
lightbox(event.element().innerHTML, spec.newValueURL);
});
+
+ $(spec.clientId).observe("tapx:multiselect:newvalue", function(event) {
+
+ var option = event.memo;
+ option.selected = true;
+
+ deselectAllOptions(selectedSelect);
+
+ moveOption(option, selectedSelect);
+
+ availableSelect.fire("tapx:refreshbuttonstate");
+ selectedSelect.fire("tapx:refreshbuttonstate");
+
+ selectedSelect.focus();
+
+ rebuildHiddenFieldValue();
+ });
}
function newValue(spec) {
Modalbox.hide();
+
+ var option = new Element("option").update(spec.label.escapeHTML());
+
+ option.txClientValue = spec.clientValue;
+
+ $(spec.clientId).fire("tapx:multiselect:newvalue", option);
}
return {

0 comments on commit 9cfbcd1

Please sign in to comment.
Something went wrong with that request. Please try again.