public function onRender()
    {

        $meta = $this->dataStore->meta();
        $showColumnKeys = array();

        if ($this->columns == array()) {
            if ($row = $this->dataStore[0]) {
                $showColumnKeys = array_keys($row);
            } else if (count($meta["columns"]) > 0) {
                $showColumnKeys = array_keys($meta["columns"]);
            }
        } else {
            foreach ($this->columns as $cKey => $cValue) {

                if ($cKey === "{others}") {
                    $allKeys = array_keys($this->dataStore[0]);
                    foreach ($allKeys as $k) {
                        if (!in_array($k, $showColumnKeys)) {
                            $meta["columns"][$k] = array_merge($meta["columns"][$k], $cValue);
                            array_push($showColumnKeys, $k);
                        }
                    }
                } else {
                    if (gettype($cValue) == "array") {
                        if ($cKey === "#") {
                            $meta["columns"][$cKey] = array(
                                "type" => "number",
                                "label" => "#",
                                "start" => 1,
                            );
                        }

                        $meta["columns"][$cKey] = array_merge($meta["columns"][$cKey], $cValue);
                        if (!in_array($cKey, $showColumnKeys)) {
                            array_push($showColumnKeys, $cKey);
                        }
                    } else {
                        if ($cValue === "#") {
                            $meta["columns"][$cValue] = array(
                                "type" => "number",
                                "label" => "#",
                                "start" => 1,
                            );
                        }
                        if (!in_array($cValue, $showColumnKeys)) {
                            array_push($showColumnKeys, $cValue);
                        }
                    }

                }
            }
        }

        $cleanColumnKeys = array();
        foreach ($showColumnKeys as $key) {
            if (!in_array($key, $this->excludedColumns)) {
                array_push($cleanColumnKeys, $key);
            }
        }
        $showColumnKeys = $cleanColumnKeys;

        if (count($this->group) === 0 && count($this->sorting)>0) {
            $this->dataStore->sort($this->sorting);
        }

        //Prepare data
        $this->template(
            "Table",
            array(
                "showColumnKeys" => $showColumnKeys,
                "meta" => $meta,
            )
        );
    }
public function onRender()
    {

        $meta = $this->dataStore->meta();
        $showColumnKeys = array();

        if ($this->columns == array()) {
            if ($row = $this->dataStore[0]) {
                $showColumnKeys = array_keys($row);
            } else if (count($meta["columns"]) > 0) {
                $showColumnKeys = array_keys($meta["columns"]);
            }
        } else {
            foreach ($this->columns as $cKey => $cValue) {

                if ($cKey === "{others}") {
                    $allKeys = array_keys($this->dataStore[0]);
                    foreach ($allKeys as $k) {
                        if (!in_array($k, $showColumnKeys)) {
                            $meta["columns"][$k] = array_merge($meta["columns"][$k], $cValue);
                            array_push($showColumnKeys, $k);
                        }
                    }
                } else {
                    if (gettype($cValue) == "array") {
                        if ($cKey === "#") {
                            $meta["columns"][$cKey] = array(
                                "type" => "number",
                                "label" => "#",
                                "start" => 1,
                            );
                        }

                        $meta["columns"][$cKey] = array_merge($meta["columns"][$cKey], $cValue);
                        if (!in_array($cKey, $showColumnKeys)) {
                            array_push($showColumnKeys, $cKey);
                        }
                    } else {
                        if ($cValue === "#") {
                            $meta["columns"][$cValue] = array(
                                "type" => "number",
                                "label" => "#",
                                "start" => 1,
                            );
                        }
                        if (!in_array($cValue, $showColumnKeys)) {
                            array_push($showColumnKeys, $cValue);
                        }
                    }

                }
            }
        }

        $cleanColumnKeys = array();
        foreach ($showColumnKeys as $key) {
            if (!in_array($key, $this->excludedColumns)) {
                array_push($cleanColumnKeys, $key);
            }
        }
        $showColumnKeys = $cleanColumnKeys;

        if (count($this->group) === 0 && count($this->sorting)>0) {
            $this->dataStore->sort($this->sorting);
        }

        //Prepare data
        $this->template(
            "Table",
            array(
                "showColumnKeys" => $showColumnKeys,
                "meta" => $meta,
            )
        );
    }
public function onRender ( ) { $ meta = $ this -> dataStore -> meta ( ) ; $ showColumnKeys = array ( ) ; if ( $ this -> columns == array ( ) ) { if ( $ row = $ this -> dataStore [ 0 ] ) { $ showColumnKeys = array_keys ( $ row ) ; } else if ( count ( $ meta [ "columns" ] ) > 0 ) { $ showColumnKeys = array_keys ( $ meta [ "columns" ] ) ; } } else { foreach ( $ this -> columns as $ cKey => $ cValue ) { if ( $ cKey === "{others}" ) { $ allKeys = array_keys ( $ this -> dataStore [ 0 ] ) ; foreach ( $ allKeys as $ k ) { if ( ! in_array ( $ k , $ showColumnKeys ) ) { $ meta [ "columns" ] [ $ k ] = array_merge ( $ meta [ "columns" ] [ $ k ] , $ cValue ) ; array_push ( $ showColumnKeys , $ k ) ; } } } else { if ( gettype ( $ cValue ) == "array" ) { if ( $ cKey === "#" ) { $ meta [ "columns" ] [ $ cKey ] = array ( "type" => "number" , "label" => "#" , "start" => 1 , ) ; } $ meta [ "columns" ] [ $ cKey ] = array_merge ( $ meta [ "columns" ] [ $ cKey ] , $ cValue ) ; if ( ! in_array ( $ cKey , $ showColumnKeys ) ) { array_push ( $ showColumnKeys , $ cKey ) ; } } else { if ( $ cValue === "#" ) { $ meta [ "columns" ] [ $ cValue ] = array ( "type" => "number" , "label" => "#" , "start" => 1 , ) ; } if ( ! in_array ( $ cValue , $ showColumnKeys ) ) { array_push ( $ showColumnKeys , $ cValue ) ; } } } } } $ cleanColumnKeys = array ( ) ; foreach ( $ showColumnKeys as $ key ) { if ( ! in_array ( $ key , $ this -> excludedColumns ) ) { array_push ( $ cleanColumnKeys , $ key ) ; } } $ showColumnKeys = $ cleanColumnKeys ; if ( count ( $ this -> group ) === 0 && count ( $ this -> sorting ) > 0 ) { $ this -> dataStore -> sort ( $ this -> sorting ) ; } //Prepare data $ this -> template ( "Table" , array ( "showColumnKeys" => $ showColumnKeys , "meta" => $ meta , ) ) ; }
Handle on widget rendering

@return null
Handle on widget rendering