src/TableColumn/Generic.php
public function addDropdown($items, $fx, $icon = 'caret square down', $menuId = null)
    {
        $menuITems = [];
        foreach ($items as $key => $item) {
            if (is_int($key)) {
                $menuITems[] = ['name' => $item, 'value' => $item];
            } else {
                $menuITems[] = ['name' => $key, 'value' => $item];
            }
        }

        $cb = $this->setHeaderDropdown($menuITems, $icon, $menuId);

        $cb->onSelectItem(function ($menu, $item) use ($fx) {
            return call_user_func($fx, $item, $menu);
        });
    }
public function addDropdown($items, $fx, $icon = 'caret square down', $menuId = null)
    {
        $menuITems = [];
        foreach ($items as $key => $item) {
            if (is_int($key)) {
                $menuITems[] = ['name' => $item, 'value' => $item];
            } else {
                $menuITems[] = ['name' => $key, 'value' => $item];
            }
        }

        $cb = $this->setHeaderDropdown($menuITems, $icon, $menuId);

        $cb->onSelectItem(function ($menu, $item) use ($fx) {
            return call_user_func($fx, $item, $menu);
        });
    }
public function addDropdown ( $ items , $ fx , $ icon = 'caret square down' , $ menuId = null ) { $ menuITems = [ ] ; foreach ( $ items as $ key => $ item ) { if ( is_int ( $ key ) ) { $ menuITems [ ] = [ 'name' => $ item , 'value' => $ item ] ; } else { $ menuITems [ ] = [ 'name' => $ key , 'value' => $ item ] ; } } $ cb = $ this -> setHeaderDropdown ( $ menuITems , $ icon , $ menuId ) ; $ cb -> onSelectItem ( function ( $ menu , $ item ) use ( $ fx ) { return call_user_func ( $ fx , $ item , $ menu ) ; } ) ; }
Add a dropdown header menu.

@param array       $items
@param callable    $fx
@param string      $icon
@param string|null $menuId The menu name.

@throws Exception
Add a dropdown header menu .