Clarity Service Management

Expand all | Collapse all

detailDropDown onclick event

  • 1.  detailDropDown onclick event

    Posted 11-10-2016 12:36 PM

    Hi all!

     

    I need that the detailDropDown on Service Desk form function call a js function when is clicked... is possible to fire it on this way?

     

    I able to do this with the PDM_MACRO field without any problem with the 'evt' tag:

    <PDM_MACRO name=dtlDropdown hdr="Tipo de Afectación Contable" attr="tipo_afectacion_contable" factory="zdemand_afectacion_contable" evt="onClick=\\\"validateOtros(this,'SET.afectacion_contable_otro')\\\"">

    but i need to know if i can do this with the detailDropdown:

     

    detailDropdown("Afectación Contable", "afectacion_contable","zdemand", 1, 20, false, "", "$args.afectacion_contable", "no", "<vacío>", "$args.afectacion_contable", "", "", "no", "", "", "","Si", "1","No","2");

     

    is it possible??



  • 2.  Re: detailDropDown onclick event

    Posted 11-11-2016 05:25 AM

    Hi,

    try to add event handler before your macro:

    detailSetEventHandler("onchange='alert(123);'");

    detailDropdown(....

    and I think that onchange should fit better than onclick.

     

    Other way:

    - register zAttEvt function in your sitemods.js file, this is crossbrowser solution that should work from IE6;

    function zAttEvt(eventName, target, handlerName){
         if (target.addEventListener) {
              target.addEventListener(eventName, handlerName, false);
         } else if (target.attachEvent) {
              target.attachEvent("on" + eventName, handlerName);
         } else {
              target["on" + eventName] = handlerName;
         }
    }

    - call it on page load (in <body> tag onload area) with arguments you want:

    attEvt('change', main_form["SET.afectacion_contable"], function(){alert(this.value);});

     

    Regards,

    cdtj