Description:
Conditional Alert / Comments on Hover is a common requirement, In Old days, it is common to use a drill-down pop-up user has to click and view comments, and after that he has to close it. If he had 100 records, it takes time to click and check on it. Instead of Click, It is better to visualize comments/alert on hover.
Step:1: In Link / Element Attributes, we can call function on mouse hover using javascript as follows:
onmouseover=”fun_status(#DELIVERY_ITEM_ID#,#DELIVERY_PDVD_ID#);”
Step:2: In function, we will check our condition and display it conditionally. It is simple, but we used it for field locks as user can be restricted to click on link when other user is using it, during hover itself we will alert him and restrict.
Following javascript is used to check whether a particular field is locked or not and we will conditionally alert them or allow in accordance with conditions
function fun_status(a,b)
{
var get = new htmldb_Get(null,$x(‘pFlowId’).value,
‘APPLICATION_PROCESS=AP_DEL_OUTPUT_CHECK’,0);
get.add(‘AI_PDVD_ID’,a);
get.add(‘AI_DELIVERY_PDVD_ID’,b);
gReturn = get.get();
var x=gReturn;
x = x.trim();
//alert(x);
if (x != “Not Exists”)
{
$(“#alert”).html(“Field has been locked by <b>”+x+”</b>”);
$(“#alert”).dialog({modal:true,resizable: false,minHeight: 105,width:380,dialogClass: ‘testclass’});
}
}
$(‘#alert’).on(‘dialogclose’, function(event) {
$(“#alert”).dialog(“destroy”);
});
Output:
Summary: This post explains about Conditional Alert / Comments on Hover
Queries?
Do drop a note by writing us at contact@staging.doyensys.com or use the comment section below to ask your questions.