Question
IT
SK
Last activity: 5 Apr 2019 15:16 EDT
Pulse gadget expanded by default?
User says: I want Pulse Gadget to be open when I login.
Do you know an elegant way to achieve this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Which version of Pega are you using? Pulse view changes from release to release in our UI Kit version. Just wanted to know which one are you using right now. I'll try to implement his functionality in that environment.
IT
SK
Pega version - 7.3.1 (in an open work object Pulse is displayed in sections pyCaseMain ->pxContextFeed). Actual requirement is to show Pulse expanded after login conditionally (e.g. when there are messages already – then show it), but finding a way to show it by default may help.
We know that js pzpega_ui_popover contains the following script (which is invoked when we click a button):
Pega version - 7.3.1 (in an open work object Pulse is displayed in sections pyCaseMain ->pxContextFeed). Actual requirement is to show Pulse expanded after login conditionally (e.g. when there are messages already – then show it), but finding a way to show it by default may help.
We know that js pzpega_ui_popover contains the following script (which is invoked when we click a button):
/* this api allows to display a section as an overlay by positioning it static and toggling the case visible */
p.u.d.toggleFixedOverlay = function (sectionName, e) {
if(e) {
var elem = e.target;
if(elem && elem.tagName=="I") elem=elem.parentElement; // fix issue with IE where the i is the focus element
$(elem).toggleClass('active');
}
var fixedElem = $('div[data-node-id="' + sectionName + '"]').first();
if(fixedElem.length==0) return;
if(fixedElem.hasClass("visible")) {
fixedElem.toggleClass('visible');
fixedElem.css('width','');
setTimeout(function() { fixedElem.css({display:'none'})}, 400);
} else {
var scrollElem = $('.workarea-view-scroll-wrapper').first();
fixedElem.css({display:'block'});
if(scrollElem.length>0) {
fixedElem.css("top", scrollElem.offset().top);
if(scrollElem.width() < fixedElem.width()) {
fixedElem.css("width", scrollElem.width());
}
}
fixedElem.toggleClass('visible');
}
};
It toggles the Pulse pain to appear or disappear by changing the css for div – namely toglling the class from “sectionDivStyle” to “sectionDivStyle visible” and vice versa:
Excerpt from Browser Developer tools:
<div data-ui-meta="{'type':'Section','ruleName':'pxContextFeed','insKey':'RULE-HTML-SECTION @BASECLASS PXCONTEXTFEED #20151229T172052.337 GMT','sectionType':'standard'}" data-template="" node_name="pxContextFeed" node_type="MAIN_RULE" name="BASE_REF" id="RULE_KEY" class="sectionDivStyle visible" style="display: block; top: 127.433px;" base_ref="" data-node-id="pxContextFeed" version="1" objclass="Rule-HTML-Section" pyclassname="@baseclass" readonly= "true" expandrl="" index="" uniqueid="SID1528900527621">
The question now is – how to define the default value for the class?
Pegasystems Inc.
US
Please refer https://stackoverflow.com/questions/507138/how-do-i-add-a-class-to-a-given-element
In our case, we can use node_name="pxContextFeed" in place of ID . Please let me know in case of any concerns.
Regards,
Rachit
IT
SK
Hi, Rachit,
Thanks for your response. The question is where to call this Javascript from?
UserWorkForm
inline style
style
what else?
All mentioned above do not seem to be a good place for it... Also, getting element by node_name requires more custom Javascript, while our requirement seems to be so reasonable.
Kind regards,
Ivan
Pegasystems Inc.
US
The section "pxContextFeed" is an autogenerated section and is a FINAL rule. Thus we cannot directly make modifications to it. You can call a function window.onload where you can check the condition(if the pulse has some data) and then add a class based on the output of this if condition.
You can write this function in userWorkform. You can also write this in some js file and add this file to harness.
Regards,
Rachit
Accenture
IN
Hi Rachit,
I am using Pega 8.1. We have a requirement to show some case level data by clicking a icon in overlay how a pulse is displayed. We have created a separatesection and using the function p.u.d.toggleFixedOverlay. But whenever we are using our section the function is not working but only working for pxFeed section.
Hi Rachit,
I am using Pega 8.1. We have a requirement to show some case level data by clicking a icon in overlay how a pulse is displayed. We have created a separatesection and using the function p.u.d.toggleFixedOverlay. But whenever we are using our section the function is not working but only working for pxFeed section.
I have checked the p.u.d.toggleFixedOverlay and in this function when I have added alert have seen fixedItem variable has null value for var fixedElem = harnessElem.querySelector('div[node_name="' + sectionName + '"]');. Not sure why this value is coming null for our secton but when I have refered pxFeed it has a valid value.
Can you please suggest how to use our section in toggleFixedOverlay function.
Pegasystems Inc.
US