Animating 'visible' binding

2 posts, 0 answers
  1. Jeremy Wiebe
    Jeremy Wiebe avatar
    11 posts
    Member since:
    Jun 2012

    Posted 04 Oct 2012 Link to this post

    So today I was using the 'visible' binding and I really wanted to have some jQuery animation when the bound element was shown/hidden.  A few minutes of research and I have a new binding (I _could_ have just extended the built-in one, but I didn't want to touch so that I didn't affect other areas of the application I've already built).  

    Just drop this javascript in a file that is loaded after the kendo javascript:

    kendo.data.binders.visible_animated = kendo.data.Binder.extend({
      refresh: function () {
        if (this.bindings.visible_animated.get()) {
          $(this.element).show('fast');
        } else {
          $(this.element).hide('fast');
        }
      }
    });

    Alternatively, it'd be cool if the built-in kendo bindings that controlled element visibility would support animations natively somehow.  :-)
  2. J
    J avatar
    8 posts
    Member since:
    Feb 2014

    Posted 09 Sep 2014 Link to this post

    I did something similar, with a couple of additions:
    http://blog.falafel.com/fading-item-visibility-with-a-kendo-ui-binding/
  3. Kendo UI is VS 2017 Ready
Back to Top