Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom inputs or widgets for value binding #118

Open
houpli opened this issue Apr 16, 2015 · 1 comment
Open

Custom inputs or widgets for value binding #118

houpli opened this issue Apr 16, 2015 · 1 comment

Comments

@houpli
Copy link

houpli commented Apr 16, 2015

Hi,

I use custom inputs widgets like DatePicker or NumericTextBox (KendoUI).
I would like to use "value" binding but I have to create my custom handler with addHandler.

Is it possible ?

Thank you

@markerikson
Copy link

Seems like that's exactly what custom handlers are intended for - creating binding interactions that aren't "standard". I've done exactly that myself with some jQuery plugins, like this one for jQuery-Knob:

        // Gets/sets the value for a $.knob() element
        knobValue : {
            set : function($element, value) {
                // Note that this does NOT appear to retrigger the knob's "change" handler, and
                // therefore we don't get into an infinite loop
                $element.val(value).trigger("change");
            },
            get: function( $element, value, event ) {
                return $element.val();
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants