Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
onBlur for the WebCombo not found/working 8.1.20081.1000
posted

I can't seem to find a way client side for the webcombo to trigger a funtion when the control loses focus usually this is the blur() or onblur() ... anyone have any ideas... it works for focus

function ddlFocus() { Log("WebCombo1:Focus"); }

var ddl = igcmbo_getComboById("WebCombo1");

ddl.focus = ddlFocus; //this works

Parents
No Data
Reply
  • 50
    posted

    I ran into this issue...here's what appears to be working for me....caveats: It's only tested for use with editable combos, and the code is only tested in IE. There's a crossbrowser attachEvent function at http://phrogz.net/JS/AttachEvent_js.txt that may be useful if you need to work in FF or downlevel browsers.

     The webcombo uses an input control internally....the basic idea is to get a reference to that input control and attach an event handler to it's onblur event.  

    var ctl = igcmbo_getComboById(comboID);
        
    if (ctl && ctl.Editable)
        {
    var box = ctl.getInputBox();
          box.attachEvent(
    "onblur",cboOnBlur);
         }

    Next is the handling function....

    function cboOnBlur(oEvent)
       {//get the id of the event source
    var srcID = oEvent.srcElement.id;
    //since the event source is actually the input control, we need to tweak the id to get the reference to the webcombo
    var cbo = igcmbo_getComboById(srcID.substr(0,srcID.length - 6));

    }

     If you were thinking of using

     cbo.attributes.add("onblur","myfunction(param,param2);") 

    forget it, Infragistics ignores your request - they always write a call to their own onblur handler into the event handler.

    igcmbo_onblur(oEvent, webComboId) 

Children
No Data