Hi!
I am using sideview utils 2.4.8 with splunk 4.3 and I am trying to reset the value of a checkbox (basically uncheck it).
Currently I have a little custom behavior that overrides the onContextChange function of the module, and hides the checkbox when the context change. But everything I have tried to do to uncheck this module doesn't seem to work (namely this.container.checked=false, this.input.check=false ...)
Can someone gives me a hint on how to do it?
Here is the code of the custom behavior:
Sideview.utils.declareCustomBehavior("hideComparativeModule", function(htmlModule) {
var visibilityReason = "customBehavior hides the module initially";
htmlModule.hide(visibilityReason);
// preserve the existing onContextChange method.
var methodReference = htmlModule.onContextChange.bind(htmlModule);
// now override the onContextChange method
htmlModule.onContextChange = function() {
var context = this.getContext();
if (context.get("single") == -1) {
this.show(visibilityReason);
} else {
// Need some code here to reset the module to unchecked when hiding!!!
this.hide(visibilityReason);
}
// but note that we both call the original method, and we also are
// careful to return the original method's return value.
return methodReference();
}
});
Many thanks