Tabs X kartik

Hello everyone ,

I’m using Tabs X extension. each tab holds some widgets. the problem is when routing to a different url the current active tab is not saved so the first tab appears . Is there any option to save the last active tab ?? and to avoid refreshing tabs when any post action done.

thanks a lot

Just set the active property for each tab in the items configuration.

For example, if you are storing something like a tab id in a variable $tab,




echo TabsX::widget([

    'position' => TabsX::POS_ABOVE,

    'align' => TabsX::ALIGN_LEFT,

    'items' => [

        [

            'label' => 'One',

            'content' => 'Anim pariatur cliche...',

            'active' => $tab === 1,

        ],

        [

            'label' => 'Two',

            'content' => 'Anim pariatur cliche...',

            'active' => $tab === 2,

        ],

        [

            'label' => 'Three',

            'content' => 'Anim pariatur cliche...',

            'active' => $tab === 3,

        ],

    ],

]);



I have just given you an idea to kick-start your thoughts. You can use the concept above to extend for your use case.