Dependent field, keyup change WITH local callback

Dependent field, keyup change WITH local callback

rldean1rldean1 Posts: 141Questions: 66Answers: 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: 15,112Questions: 1Answers: 2,583
    edited March 2020 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

  • rldean1rldean1 Posts: 141Questions: 66Answers: 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)

This discussion has been closed.