public function getDataAction()
    {
        $request           = $this->getRequest();
        $dataCount         = 0;
        $dataFilteredCount = 0;
        $tableData         = array();
        $draw              = 0;
        if($request->isPost()) {

            $post           = get_object_vars($request->getPost());
            $columns        = array_keys($this->tool()->getColumns());
            $draw           = (int) $post['draw'];
            $selColOrder    = $columns[(int) $post['order'][0]['column']];
            $orderDirection = isset($post['order']['0']['dir']) ? strtoupper($post['order']['0']['dir']) : 'ASC';
            $searchValue    = isset($post['search']['value']) ? $post['search']['value'] : null;
            $searchableCols = $this->tool()->getSearchableColumns();
            $start          = (int) $post['start'];
            $length         = (int) $post['length'];

            $data              = $this->themeTable()->getData($searchValue, $searchableCols, $selColOrder, $orderDirection, $start, $length)->toArray();
            $dataCount         = $this->themeTable()->getTotalData();
            $dataFilteredCount = $this->themeTable()->getTotalFiltered();
            $tableData         = $data;

            for($ctr = 0; $ctr < count($tableData); $ctr++) {
                // apply text limits
                foreach($tableData[$ctr] as $vKey => $vValue) {
                    $tableData[$ctr][$vKey] = $this->tool()->limitedText($vValue, 80);
                }

                $tableData[$ctr]['DT_RowId'] = $tableData[$ctr]['pros_theme_id'];
            }
        }

        $response = [
            'draw'            => $draw,
            'data'            => $tableData,
            'recordsFiltered' => $dataFilteredCount,
            'recordsTotal'    => $dataCount
        ];

        return new JsonModel($response);
    }
public function getDataAction()
    {
        $request           = $this->getRequest();
        $dataCount         = 0;
        $dataFilteredCount = 0;
        $tableData         = array();
        $draw              = 0;
        if($request->isPost()) {

            $post           = get_object_vars($request->getPost());
            $columns        = array_keys($this->tool()->getColumns());
            $draw           = (int) $post['draw'];
            $selColOrder    = $columns[(int) $post['order'][0]['column']];
            $orderDirection = isset($post['order']['0']['dir']) ? strtoupper($post['order']['0']['dir']) : 'ASC';
            $searchValue    = isset($post['search']['value']) ? $post['search']['value'] : null;
            $searchableCols = $this->tool()->getSearchableColumns();
            $start          = (int) $post['start'];
            $length         = (int) $post['length'];

            $data              = $this->themeTable()->getData($searchValue, $searchableCols, $selColOrder, $orderDirection, $start, $length)->toArray();
            $dataCount         = $this->themeTable()->getTotalData();
            $dataFilteredCount = $this->themeTable()->getTotalFiltered();
            $tableData         = $data;

            for($ctr = 0; $ctr < count($tableData); $ctr++) {
                // apply text limits
                foreach($tableData[$ctr] as $vKey => $vValue) {
                    $tableData[$ctr][$vKey] = $this->tool()->limitedText($vValue, 80);
                }

                $tableData[$ctr]['DT_RowId'] = $tableData[$ctr]['pros_theme_id'];
            }
        }

        $response = [
            'draw'            => $draw,
            'data'            => $tableData,
            'recordsFiltered' => $dataFilteredCount,
            'recordsTotal'    => $dataCount
        ];

        return new JsonModel($response);
    }
public function getDataAction ( ) { $ request = $ this -> getRequest ( ) ; $ dataCount = 0 ; $ dataFilteredCount = 0 ; $ tableData = array ( ) ; $ draw = 0 ; if ( $ request -> isPost ( ) ) { $ post = get_object_vars ( $ request -> getPost ( ) ) ; $ columns = array_keys ( $ this -> tool ( ) -> getColumns ( ) ) ; $ draw = ( int ) $ post [ 'draw' ] ; $ selColOrder = $ columns [ ( int ) $ post [ 'order' ] [ 0 ] [ 'column' ] ] ; $ orderDirection = isset ( $ post [ 'order' ] [ '0' ] [ 'dir' ] ) ? strtoupper ( $ post [ 'order' ] [ '0' ] [ 'dir' ] ) : 'ASC' ; $ searchValue = isset ( $ post [ 'search' ] [ 'value' ] ) ? $ post [ 'search' ] [ 'value' ] : null ; $ searchableCols = $ this -> tool ( ) -> getSearchableColumns ( ) ; $ start = ( int ) $ post [ 'start' ] ; $ length = ( int ) $ post [ 'length' ] ; $ data = $ this -> themeTable ( ) -> getData ( $ searchValue , $ searchableCols , $ selColOrder , $ orderDirection , $ start , $ length ) -> toArray ( ) ; $ dataCount = $ this -> themeTable ( ) -> getTotalData ( ) ; $ dataFilteredCount = $ this -> themeTable ( ) -> getTotalFiltered ( ) ; $ tableData = $ data ; for ( $ ctr = 0 ; $ ctr < count ( $ tableData ) ; $ ctr ++ ) { // apply text limits foreach ( $ tableData [ $ ctr ] as $ vKey => $ vValue ) { $ tableData [ $ ctr ] [ $ vKey ] = $ this -> tool ( ) -> limitedText ( $ vValue , 80 ) ; } $ tableData [ $ ctr ] [ 'DT_RowId' ] = $ tableData [ $ ctr ] [ 'pros_theme_id' ] ; } } $ response = [ 'draw' => $ draw , 'data' => $ tableData , 'recordsFiltered' => $ dataFilteredCount , 'recordsTotal' => $ dataCount ] ; return new JsonModel ( $ response ) ; }
Returns the theme items for the data table
@return JsonModel
Returns the theme items for the data table