Dependent field, keyup change WITH local callback

Dependent field, keyup change WITH local callback

raydlevel5raydlevel5 Posts: 112Questions: 49Answers: 1

How do I include the 'keyup change' events along WITH this "local callback" style template?

As you can see, I'm returning a value, but I don't know how to also include the 'change keyup' events as described in the examples.

                                }).dependent('Formula', function (val, data, callback) {
                                    event: 'change keyup',
                                    return (val) ?
                                        {
                                            "values": {
                                                "Factor": bigmath.round(bigmath.evaluate(val), 28)
                                            }
                                        } :
                                        {
                                            "values": {
                                                "Factor": ""
                                            }
                                        };

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 8,033Questions: 0Answers: 1,349
    edited March 6 Answer ✓

    The events are options, so they're the third parameter for dependent(), so you should have something like:

    }).dependent('Formula', function(val, data, callback) {
        return (val) ? {
            "values": {
                "Factor": bigmath.round(bigmath.evaluate(val), 28)
            }
        } : {
            "values": {
                "Factor": ""
            }
        };
    }, {event: 'change keyup'} )
    

    Colin

  • raydlevel5raydlevel5 Posts: 112Questions: 49Answers: 1

    @colin I just want y'all to know that this is really cool. This is definitely a newer feature, it seems... Also: having access to that callback is fantastic. (I'm dealing with a lot of complicated "manual" stuff.... soooo.... being able to send & execute that callback where I need it is pretty cool)

Sign In or Register to comment.