In my CodeIgniter I have a Login controller that load this view:
<ul class="sub-menu">
<li>
<a href="javascript:;" class = "menu-item" data-target="../indoamericana/soporte/callSupport/"> Mis solicitudes </a>
</li>
</ul>
The controller: soporte, function: callSupport
public function callSupport($index = null, $order = null){
$session_data = $this->session->userdata('session_user');
$data['solicitud'] = $this->helpdesk_model->getRequest($session_data['usuario'], $index, $order);
$data['categories'] = $this->helpdesk_model->getCategories();
$this->load->view('modules/help_desk/supports', $data);
}
With jQuery I call the controller and render in a page content that is a div:
$(".sub-menu .menu-item, .module-item").click(function(event) {
$(".page-content").load($(this).data('target'));
$("title").text( $( this ).text() );
});
In the view 'modules/help_desk/supports':
<table class="table table-striped table-hover" id="admin-support" data-target="soporte/callSupport/">
<thead>
<tr>
<th>Estado <a href="javascript:;"><i class="icon-sort" data-sort="status"></i></a></th>
<th>Prioridad <a href="javascript:;"><i class="icon-sort" data-sort="priority"></i></a></th>
<th>Responsable <a href="javascript:;"><i class="icon-sort" data-sort="id_responsible"></i></a></th>
</tr>
</thead>
<tbody>
<?php foreach ($solicitud as $key => $value) { ?>
<tr>
<td><span class="label label-sm <?= $value['label']?> "><?= ucfirst($value['status']) ?></span></td>
<td><span class="badge <?= $value['class']?> "><?= $value['priority'] ?></span></td>
<td><?= $value['name'].' '.$value['last_name'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
As you can see, in the first 'td' a put an anchor tag calls another controller with jQuery similar than before. Please be critical, very severe with me.