Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / IGX Grid – Controls in Column Header Template (input, select, etc) don't get focus when click on it, because of the header gets the focus inmediately

IGX Grid – Controls in Column Header Template (input, select, etc) don't get focus when click on it, because of the header gets the focus inmediately

New Discussion
Jesus Murillo
Jesus Murillo asked on Feb 18, 2021 12:49 PM

I need a input text on the header of certain columns, i found some examples of that, using headerTemplate, but only works on Ignite version 8 and 9, but in v10 it doesn’t work because the header gets the focus automatically.

The column is in a Collapsible Column Group

Exists some property or function that i need to add or remove to get the desired functionality.

Let me to know if need more information.

Thanks in advance.

Sign In to post a reply

Replies

  • 0
    Teodosia Hristodorova
    Teodosia Hristodorova answered on Feb 18, 2021 12:49 PM

    Hello,


    I have been looking into your question and prepared a small sample using igniteui-angular version 10.1 with collapsible column groups and input in the header of one of the columns in the groups.


    In the igxHeader template, I added a div container with an input-group. In order to prevent further propagation of the click and keydown events in the capturing and bubbling phases, my suggestion is to call the events stopPropagation method on div container click and on keydown on the input.


    Additionally, since the stopPropagation would not prevent any default behaviors from occurring,  on pointerdown event on the input, my suggestion is to call the preventDefault method too and set the focus to the input:

      pDown(args, input) {
        args.stopPropagation();
        args.preventDefault();
        input.focus();
      }



    Here could be found my sample for your reference. Please test it on your side and let me know if I may be of any further assistance.


    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Jesus Murillo
Favorites
0
Replies
1
Created On
Feb 18, 2021
Last Post
5 years ago

Suggested Discussions

Created by

Created on

Feb 18, 2021 12:49 PM

Last activity on

Feb 19, 2026 9:23 PM