Ui/Component/Listing/Column/TopicActions.php
/**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
Prepare Data Source
@param array $dataSource
@return array
Prepare Data Source @param array $dataSource @return array
public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as & $item) {
                $name = $this->getData('name');
                if (isset($item['topic_id'])) {
                    $item[$name]['edit'] = [
                        'href' => $this->urlBuilder->getUrl(self::URL_PATH_EDIT, ['topic_id' => $item['topic_id']]),
                        'label' => __('Edit')
                    ];
                    $item[$name]['delete'] = [
                        'href' => $this->urlBuilder->getUrl(self::URL_PATH_DELETE, ['topic_id' => $item['topic_id']]),
                        'label' => __('Delete'),
                        'confirm' => [
                            'title' => __('Delete ${ $.$data.title }'),
                            'message' => __('Are you sure you wan\'t to delete a ${ $.$data.title } record?')
                        ]
                    ];
                }
            }
        }
        return $dataSource;
    }
public function prepareDataSource ( array $ dataSource ) { if ( isset ( $ dataSource [ 'data' ] [ 'items' ] ) ) { foreach ( $ dataSource [ 'data' ] [ 'items' ] as & $ item ) { $ name = $ this -> getData ( 'name' ) ; if ( isset ( $ item [ 'topic_id' ] ) ) { $ item [ $ name ] [ 'edit' ] = [ 'href' => $ this -> urlBuilder -> getUrl ( self :: URL_PATH_EDIT , [ 'topic_id' => $ item [ 'topic_id' ] ] ) , 'label' => __ ( 'Edit' ) ] ; $ item [ $ name ] [ 'delete' ] = [ 'href' => $ this -> urlBuilder -> getUrl ( self :: URL_PATH_DELETE , [ 'topic_id' => $ item [ 'topic_id' ] ] ) , 'label' => __ ( 'Delete' ) , 'confirm' => [ 'title' => __ ( 'Delete ${ $.$data.title }' ) , 'message' => __ ( 'Are you sure you wan\'t to delete a ${ $.$data.title } record?' ) ] ] ; } } } return $ dataSource ; }
Prepare Data Source
 @param array $dataSource
 @return array
Prepare Data Source @param array $dataSource @return array