Q:

yii2 grid view filter text field content auto-selected

In the grid view (Kartik) I would like to make any text in the text field of the filter (from previous filtering) to be selected as if I had double clicked it with mouse. So I can type a new filtering without the need to double click the field first to be able to immediately overwrite the previous value. I've searched, found nothing, tried intuitively like this, don't work:
[
    'attribute' => 'numbern',
    'filterInputOptions' => [
        'class' => 'form-control',
        'autofocus' => true,
        'selected' => true,
    ],
],

Can you please point me into the right direction? Thanks!

A:

Maybe some extra javascript like this (not tested)...
[
    'attribute' => 'numbern',
    'filterInputOptions' => [
        'class' => 'form-control',
        'autofocus' => true,
        'onFocus' => 'this.select()',
    ],
],

