Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3198 Widoki

I am trying set hotkey (ctrl + x) to focus input text but it doesn't work.
My code here:

<html>

<input id="text_input" type="search" class="form-control shadow-none" placeholder="Search...."
</input>

<JS>

    Widget.extend({
        template: 'systray_odoo_search.search_icon',           
        events: {
            'keydown': '_onKeydown_searchFocus',
            // 'show.bs.dropdown': '_onActivityMenuShow',
            // 'hide.bs.dropdown': '_onActivityMenuHide',
        },
    _onKeydown_searchFocus: function (e) {
            var self = this;
            if (e.ctrlKey && e.keyCode == 'X'.charCodeAt(0)) {
                self.$('#text_input').focus();
                e.preventDefault();
            }
        },

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lut 18
3471
0
wrz 17
4310
2
lis 15
767
1
lut 24
12087
0
mar 15
418