Programmatically trigger legendItemClick event

3 posts, 0 answers
  1. James
    James avatar
    2 posts
    Member since:
    Mar 2013

    Posted 12 Dec 2013 Link to this post

    Hello-

    In release v2013.2.918 we were taking advantage of the chart's legendItemClick default functionality of hiding series on a click event.

    We also had some add'l buttons on our page that we tied in to this functionality to programmatically trigger the legendItemClick with a simple:

    $('legend-item-element').click()

    and the user could click these other (non-Kendo) buttons and show/hide chart series. This worked great - see this fiddle:

    http://jsfiddle.net/gtP55/


    Since the last release, we can no longer successfully call $('legend-item-element').click(). The click event is not properly triggered programatically. Is there any way to do so? This functionality is heavily enmeshed in our page now and users are expecting it.

    Thanks!

    James
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 13 Dec 2013 Link to this post

    Hello James,

    I am afraid that programmatically showing or hiding series is currently not supported out of the box, thus we cannot guarantee that the workaround you found will work in further releases. I would suggest you to submit a feature request to our feedback portal, so other members of the community can evaluate, comment on and vote for it. Most voted ideas are included in next KendoUI releases. Although I recommend against it, you could use the _legendItemClick method as a workaround, however you should keep in mind that using private methods is generally considered a bad practice. For convenience I prepared this small example, which demonstrates the described functionality.

    Regards,
    Alexander Popov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. James
    James avatar
    2 posts
    Member since:
    Mar 2013

    Posted 13 Dec 2013 Link to this post

    Excellent thanks for the response Alexander. We do try to never utilize private methods but _legendItemClick will allow us to gracefully transition in the meantime. I submitted the idea for a public method as suggested.

    Have a good day-

    James
Back to Top