Focus | Filter Menu

2 posts, 0 answers
  1. Rajesh
    Rajesh avatar
    13 posts
    Member since:
    Mar 2011

    Posted 15 Aug 2013 Link to this post


    Hello Team, 

    There is filter menu which get displayed when you click filter icon. Have added the code to display the same when you hit enter or space bar key . Below is the piece of code


    Now once i am done i want to move the focus the tab on the clear filter icon and move to the next element . I am not able to do this. even i tried to set the focus. 

    Is it possible to do ?

      $('.t-icon.t-filter').each(function () {
            $(this).attr('tabindex', '0')
            $(this).attr('title', 'Edit Filter')

            $(this).live('keydown', function (e) {
                var keyCode = e.keyCode || e.which;
                if (keyCode == 13 | keyCode == 32) {
                    $(this).click();                     // show the filter pop up on enter or spacebar

                    
                }

            });
        });
  2. Daniel
    Admin
    Daniel avatar
    2226 posts

    Posted 20 Aug 2013 Link to this post

    Hello Rajesh,

    You should use the filtermenu popup activate event in order to wait for the element to become visible and to be able to focus it. In order to bind the event handler I can suggest to use the filterMenuInit event e.g.

    function filterInit(e) {
        var popup = e.container.data("kendoPopup");
        popup.bind("activate", function (e) {
            this.element.find("button[type=reset]").focus();
        });
    }
    Regards,
    Daniel
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top