Welcome Guest, Not a member yet? Register   Sign In
how can i pass these values via parameters?
#1

[eluser]rajneeshgobin[/eluser]
in a helper i have this code


Code:
$parents = $CI->[color=purple]parentmodel[/color]->[color=pink]get_paged_list[/color]($limit, $offset)->result();

foreach ($parents as $parent){  
   $CI->table->add_row(++$i, $parent->[color=red]usergroup[/color], $parent->[color=greenplatform[/color], $parent->reference,$parent->[color=orange]id[/color]);
  }

and also

Code:
$data['usergroup']    = $CI->input->post('usergroup');
  $data['platform']      = $CI->input->post('platform');  
  $data['reference']      = $CI->input->post('reference');
  $data['id']       = $CI->input->post('id');

is it possible to get the the following via parameters?
foreach ($parents as $parent){
$CI->table->add_row(++$i, $parent->usergroup, $parent->[color=greenplatform[/color], $parent->reference,$parent->id);
}[/code]
the usergroup, id reference ect and also the

$data['usergroup'] = $CI->input->post('usergroup');
$data['platform'] = $CI->input->post('platform');
$data['reference'] = $CI->input->post('reference');
$data['id'] = $CI->input->post('id');[/code]
#2

[eluser]InsiteFX[/eluser]
If you look in the CodeIgniter Users Guide there is a Table Template that you can setup to do just that.

Code:
// Needs to be updated to the CI 2.2.0 version of Table Template.
/**
  * __construct()
  *
  * Class Constuctor PHP 5+
  *
  * @access public
  * @param string
  * @return void
  */
public function __construct()
{
  parent::__construct();

  $this->load->library('table');
  $this->load->database();
  $this->load->helper('url');

  $tmpl = array (
   'table_open'   => '<table border="0" cellpadding="4" cellspacing="0">',

   'thead_open'   => '<thead>',
   'thead_close'   => '</thead>',

   'heading_row_start'  => '<tr>',
   'heading_row_end'  => '</tr>',
   'heading_cell_start' => '<th>',
   'heading_cell_end'  => '</th>',

   'tbody_open'   => '<tbody>',
   'tbody_close'   => '</tbody>',

   'row_start'    => '<tr>',
   'row_end'    => '</tr>',
   'cell_start'   => '<td>',
   'cell_end'    => '</td>',

   'row_alt_start'   => '<tr class="alt">',
   'row_alt_end'   => '</tr>',
   'cell_alt_start'  => '<td>',
   'cell_alt_end'   => '</td>',

   'table_close'   => '</table>'
  );

  $this->table->set_template($tmpl);
}

You will need to create a CSS class for .alt tr assign your colors to them.




Theme © iAndrew 2016 - Forum software by © MyBB