For those wonder what I ended up doing... here it is:
<module name="Search"> ...
<module name="HTML"> ...
<module name="Search"> ...
<module name="Table"><param name="cssClass">...</module></module>
<module name="Search">...
<module name="Table"><param name="cssClass">...</module></module>
<module name="Search">...
<module name="Table"><param name="cssClass">...</module></module>
<module name="Search">...
<module name="Table"><param name="cssClass">...</module></module>
1) the first search-module populates the first html-module - which essentially contains the 4 items to be clicked; inside css, changed the cursor to "pointer" for each of the <div> tags, added a :hover style so that the div looks like a button; and added an 'onclick' attribute to the <div> - that way, when the div is clicked, I can respond to it from js
2) the subsequent 4 blocks of Search/Table modules will dispatch immediately, but are hidden from view using js/css - essentially, onload - adds a css-class (ie. display: none;) to each of the blocks
3) from the function responding to the onclick-event, I just pass in additional arguments so I know which of the blocks to display
I guess it might be a little hard to understand from my vague explanation, so here is some sample code:
in my .js file
Sideview.utils.declareCustomBehavior("qm_customKPIresults", function(htmlModule) {
var methodReference = htmlModule.onContextChange.bind(htmlModule);
htmlModule.onContextChange = function() {
console.log("hello customBehavior [qm_customKPIresults]");
// hide results-table
$(".panel_row15_col").css("display", "none");
$(".customKPItable").addClass("hideResults");
return methodReference();
}
});
function customKPIresults_clicked(e, s)
{
console.log("hello function [customKPIresults_clicked]");
// make sure the panel is visible
$(".panel_row15_col").css("display", "block");
// figure out which of the 4 single-values to highlight
$(".customKPIresults").removeClass("customKPIresults_selected");
$("." + e.classList[1]).addClass("customKPIresults_selected");
// hide all results-table
$(".customKPItable").addClass("hideResults");
// show only the result-table for associated clicked-item
$("." + s).removeClass("hideResults");
}
the css part
.customKPIresults
{
border-color: rgba(0, 0, 0, 0.3); border-radius: 5px; border-style: solid; border-width: 1px;
cursor: pointer; float: left; margin: 0px 10px; padding: 0px 5px;
width: 150px;
}
.customKPIresults:hover { background: gainsboro; }
.customKPIresults label { font-size: 15px; font-weight: bold; }
.customKPIresults p { font-size: 20px; margin: 5px 0px; text-align: center; }
.customKPIresults_selected { background: yellow; }
.panel_row15_col { min-height: 300px; }
.hideResults { display: none !important; }
sample html for 1 of the 4 click-items:
<div class="customKPIresults kpi_ap_count" onclick="customKPIresults_clicked(this, 'my_css_class1')">
<label>my label text</label>
<p>$some-result-from-upstream-search$</p>
1 of the 4 Search/Table result blocks
<module name="Search" layoutPanel="panel_row15_col1">
<param name="search">some SPL here</param>
<module name="Table">
<param name="cssClass">customKPItable my_css_class1</param>
</module>
</module>
</div>
questions and comments welcome.
... View more