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
395
igcmbo_setDisplayValue firing events when not asked to
posted

We're a version or two behind (trying to get approval for a new version!), but I just wanted to see whether this particular issue has been fixed/updated in the newer versions, because I haven't found mention of it anywhere.

We use igcmbo_setDisplayValue in our Javascript after getting new data back from the server. We call it very simply: webCombo.setDisplayValue(nodeValue, false)

The "false" parameter is to prevent events from firing (the three possible parameters are: newValue, bFireEvent and bNoPostUpdate)

This parameter, however, is not quite respected.

There is a call to: this.grid.setActiveRow(cell.Row); in igcmbo_setDisplayValue. This is incorrect - it is missing parameters.

setActiveRow takes three parameters: row, force and fireEvents. If fireEvents is undefined, it gets set to true:

    if(typeof(fireEvents)=="undefined")
        fireEvents=true;

It should have called: this.grid.setActiveRow(cell.Row, undefined, bFireEvents); instead.

The symptom we end up with is that the whole frame jerks around to get the WebCombo in view.

I'm going to try to bypass it by setting a secret property (e.g. webCombo.grid.suppressFireEvent) and overriding grid.setActiveRow with a near-identical prototype that checks the secret property when checking fireEvents.

Parents
No Data
Reply
  • 395
    posted

    The workaround worked.

    I overrode the grid's setActiveRow prototype:

    function overrideSetActiveRow() {
        // Workaround for igcmbo_setDisplayValue jerking the screen around
        igtbl_Grid.prototype["setActiveRow"] =
            function(row, force, fireEvents) {
                if (!this.Activation.AllowActivation || this._insideSetActive)
                    return;
                if (typeof (fireEvents) == "undefined") {
                    if (this.suppressFireEventsOnce) {
                        fireEvents = false;
                        this.suppressFireEventsOnce = false;
                    }
                    else
                        fireEvents = true;
                }
    ...the rest of the setActiveRow source code... }  }

    Run the override in your page's BLOCKED SCRIPT

        <script type="text/javascript">overrideSetActiveRow();</script>

    We then set our new "suppressFireEventsOnce" property whenever we want to make sure that the web combo will not gain focus:

    webCombo.grid.suppressFireEventsOnce = true;

    No more on-screen jumping about when we set the WebCombo's value through JavaScript.

Children
No Data