This is a migrated thread and some comments may be shown as answers.

Focus | Filter Menu

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 16 Aug 2013, 12:44 AM

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

                
            }

        });
    });

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 20 Aug 2013, 07:14 AM
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!
Tags
Grid
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or