We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to make a call_back bring me a view in the datatable but I get a problem this is my code:
Model
public function usuarioDataTableJson() { // We loaded the helper that generates buttons $this->load->helper('botones'); $this->datatables ->select("usuarioId AS checkbox, usuarioId, usuario, perfil, empleado, empresa, departamento", FALSE) ->from('vista_usuarios') ->edit_column('checkbox', '<label><input type="checkbox" class="ace" name="usuarios[]" value="$1" /><span class="lbl"></span></label>', 'usuarioId') ->add_column('action', '$1', 'crearBotonAccion(usuarioId, "usuario", empleado, "editar")'); return $this->datatables->generate(); }
Helper
function crearBotonAccion($ID=0,$modulo='',$titulo='',$accion='') { $CI =& get_instance(); $CI->load->library('session'); $arrayKey= array(); $data = array(); foreach ($CI->session->userdata('SubModulos') as $value) { $arrayKey = array( 'agregar' => $value->agregar, 'ver' => $value->ver, 'editar' => $value->editar, 'eliminar' => $value->eliminar, ); $data = array( 'urlAgregar' =>base_url().strtolower($titulo).'/'.$accion, 'url' => base_url().strtolower($titulo).'/'.$accion.'/'.$ID, 'titulo' => strtolower($titulo), 'accion' => $accion, 'id' => $titulo."_".$accion, ); if($value->nombre == $modulo && $arrayKey[$accion] =='si') { return $CI->load->view("botones/".$accion, $data); } } }
If it can be noted in the method we introduce edit_column HTML, here everything goes well
edit_column('checkbox', '<label><input type="checkbox" class="ace" name="usuarios[]" value="$1" /><span class="lbl"></span></label>', 'usuarioId')
But the method add_column where I have a function that returns me a view instead of retornarme html, I get an error
->add_column('action', '$1', 'crearBotonAccion(usuarioId, "usuario", empleado, "editar")')
return $CI->load->view("botones/".$accion, $data);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to make a call_back bring me a view in the datatable but I get a problem this is my code:
Model
Helper
If it can be noted in the method we introduce edit_column HTML, here everything goes well
But the method add_column where I have a function that returns me a view instead of retornarme html, I get an error
The text was updated successfully, but these errors were encountered: