demos/popup.php
public function linkCart(Cart $cart, $jsAction = null)
    {
        $this->on('click', '.item', function ($a, $b) use ($cart, $jsAction) {
            $cart->addItem($b);

            return $jsAction;
        }, [(new \atk4\ui\jQuery())->text()]);
    }
public function linkCart(Cart $cart, $jsAction = null)
    {
        $this->on('click', '.item', function ($a, $b) use ($cart, $jsAction) {
            $cart->addItem($b);

            return $jsAction;
        }, [(new \atk4\ui\jQuery())->text()]);
    }
public function linkCart ( Cart $ cart , $ jsAction = null ) { $ this -> on ( 'click' , '.item' , function ( $ a , $ b ) use ( $ cart , $ jsAction ) { $ cart -> addItem ( $ b ) ; return $ jsAction ; } , [ ( new \ atk4 \ ui \ jQuery ( ) ) -> text ( ) ] ) ; }
Associate your shelf with cart, so that when item is clicked, the content of a
cart is updated.

Also - you can supply jsAction to execute when this happens.
Associate your shelf with cart so that when item is clicked the content of a cart is updated .