Datagrid Simple Con Paginado

De KumbiaPHP Framework Wiki

falta corregir


 View::partial('datagrid/paginado', 
  				false,
	 			 array(	'Modelo' => $page ,
						'Campos' => array(	'Codigo' => 'id',
									'Nombre' => 'nombre',
									'Telefono' => 'telefono',
									'Direccion' => 'direccion'),
	 			 		'paginator' => 'extended',
	 			 		'url' => null)
				)
		echo "<div id=\"datagrid\">";
		echo "<table  border=\"0px\" class=\"paginator\">";
		
		echo "<thead><tr>";
			foreach( $Campos  as $titulo => $valor):
				echo "<th>" . $titulo . "</th>";
			endforeach;
		echo "</tr></thead><tbody>";
			foreach( $Modelo->items as $model):
				echo tr_color_class( 'tr_primary', 'tr_secondary' );
					foreach($Campos as  $campos):
						echo "<td>". $model->$campos . "</td>";
					endforeach;
					
					echo "<td style=\"width: 33px\">" . link_to("admin/dirigente/edit/".$model->id , img_tag("iconos/page_edit.png")) ;
					echo  link_to("admin/dirigente/show/".$model->id , img_tag("iconos/page_white_acrobat.png")) ."</td>" ;
				echo "</tr>";
			endforeach;
		echo "</tbody></table>";
		
		View::partial('paginators/'. $paginator, false, array('page' => $Modelo ,'url' => $url)); 
		
		
		
		echo "</div>";