Prado\Data\ActiveRecord\Scaffold\TScaffoldListView::initializeSort PHP Method

initializeSort() protected method

Initialize the sort drop down list and the column names repeater.
protected initializeSort ( )
    protected function initializeSort()
    {
        $table = $this->getTableInfo();
        $sorts = array('Sort By', str_repeat('-', 15));
        $headers = array();
        foreach ($table->getColumns() as $name => $colum) {
            $fname = ucwords(str_replace('_', ' ', $name));
            $sorts[$name . ' ASC'] = $fname . ' Ascending';
            $sorts[$name . ' DESC'] = $fname . ' Descending';
            $headers[] = $fname;
        }
        $this->_sort->setDataSource($sorts);
        $this->_sort->dataBind();
        $this->_header->setDataSource($headers);
        $this->_header->dataBind();
    }