public function getColumnsModel($rebuild = false)
    {
        $returnValue = array();

        
		foreach($this->columns as $column){

			if($column instanceof tao_helpers_grid_Column){

				$returnValue[$column->getId()] = array(
					'id' => $column->getId(),
					'title' => $column->getTitle(),
					'type' => $column->getType()
				);

				foreach($column->getOptions() as $optionsName=>$optionValue){
					$returnValue[$column->getId()][$optionsName] = $optionValue;
				}

				if($column->hasAdapter('tao_helpers_grid_Cell_SubgridAdapter')){
        			$subGridAdapter = null;
					$adapters = $column->getAdapters();
        			$adaptersLength = count($adapters);
        			for($i=$adaptersLength-1; $i>=0; $i--){
        				if($adapters[$i] instanceof tao_helpers_grid_Cell_SubgridAdapter){
        					$subGridAdapter = $adapters[$i];
        					break;
        				}
        			}
					$returnValue[$column->getId()]['subgrids'] = $subGridAdapter->getGridContainer()->getGrid()->getColumnsModel();
				}
			}

		}

        

        return (array) $returnValue;
    }