⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Error after integrate with adminlte



jep
  • profile picture
  • Member

Posted 02 October 2019 - 23:59 PM

hello all!! thank you in advance for any help you can provide.

 

i have a little codeigniter project with grocery crud and mysql. it is working fine but i want to use adminlte in order to add new features.

 

im working with adminlte blank page template

 

versions-------------------------------------------

codeigniter 3.1.9

grocerucrud 1.6.3

adminlte 2

 

dir sctructure---------------------------------------

httdocs

-----------web

-----------------assets

--------------------------adminlte

 

controller------------------------------------------------------------------------------------------------------------------

public function f_cargadatos($v_where=null) {                                

try {

 

$v_where = "mhwh_fk_etarea!='Cancelado' AND mhwh_fk_etarea!='Vencido' AND mhwh_fk_etarea!='Realizado'";

 

$crud = new grocery_CRUD();

$this->load->config('grocery_crud');

$this->config->set_item('grocery_crud_file_upload_allow_file_types','gif|jpeg|jpg|png|pdf');

$crud->set_theme('datatables');

$crud->set_table('t_mhw_header');                                  

$crud->set_subject('Movimiento HW');

$crud->where($v_where);

 

$crud->required_fields('mhwh_id_ticket','mhwh_fhrealizacion','mhwh_fk_etarea');

 

$crud->columns(array( 'id_mhwh' , 'mhwh_fk_cliente' , 'mhwh_reponsable'  , 'mhwh_id_ticket' , 'mhwh_fk_sala' , 'mhwh_fk_etarea', 'mhwh_observaciones'));

 

$crud->fields('mhwh_id_ticket', 'mhwh_fhrealizacion', 'mhwh_fk_edificio', 'mhwh_fk_sala', 'mhwh_reponsable', 'mhwh_fk_cliente' , 'mhwh_observaciones', 'mhwh_firma', 'mhwh_fk_ssff', 'mhwh_fk_etarea', 'mhwh_creator','mhwh_updater');

 

$crud->field_type('mhwh_creator', 'invisible');

$crud->field_type('mhwh_updater', 'invisible');

                                                                                                          

$crud->set_relation('mhwh_fk_tdocumento' ,'lst_tipo_documentos' ,'id_tdocumentos'      );

$crud->set_relation('mhwh_fk_etarea'        ,'lst_estado_tareas' ,'id_estado_tarea');

$crud->set_relation('mhwh_reponsable' ,'lst_responsables'        ,'id_resp_nombre');

$crud->set_relation('mhwh_fk_ssff'            ,'lst_operariosssff'           ,'id_opersssff');

$crud->set_relation('mhwh_fk_sala'            ,'lst_salas'          ,'id_salas');

$crud->set_relation('mhwh_fk_edificio' ,'lst_edificios'          ,'id_edificios');

$crud->set_relation('mhwh_fk_cliente' ,'lst_clientes','id_cliente');

 

$crud->set_rules ('mhwh_id_ticket','Solicitud N°','trim|alpha_numeric_spaces|required');

$output = $crud->render ();                 

$this->_load_outputHead($output);

 

}catch(Exception $e) { show_error($e->getMessage().' --- ‘. $e->getTraceAsString());  }}

 

public function _load_outputHead($output = null)

{           $this->load->view('app_3wmhw/view’, (array)$output); }

 

view-----------------------------------------------------------------------------------------------------------------------

<?php $this->load->view('app_3widc/vh_3widc'); ?>
 
    <!-- Main content -->
    <section class="content">
 
      <!-- Default box -->
      <div class="box">
        <div class="box-header with-border">
          <h3 class="box-title">Title</h3>
 
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip"
                    title="Collapse">
              <i class="fa fa-minus"></i></button>
     </div>
        </div>
        <div class="box-body">
 
 
            <div class="box">
              <div class="box-header with-border">
                <h3 class="box-title">Collapsible Box Example</h3>
                <div class="box-tools pull-right">
                  <!-- Collapse Button -->
                  <button type="button" class="btn btn-box-tool" data-widget="collapse">
                    <i class="fa fa-minus"></i>
                  </button>
                </div>
                <!-- /.box-tools -->
              </div>              <!-- /.box-header -->
              <div class="box-body">  
 
 
                        <!-- BODY   --------------------------------------------------------------------------------------------- -->
                        <div class="w3-display-container">
                            <div class="w3-display-middle w3-large " id=" body" style="padding: 10px;" >  
                                   <?php echo $output;   ?>
                            </div>
                        </div>
                        <!-- FIN_BODY------------------------------------------------------------------------------------------------- -->
 
 
              </div>
            </div>            <!-- /.box -->
        </div>        <!-- /.box-body -->
        <div class="box-footer">  Footer  </div>        <!-- /.box-footer-->
      </div>      <!-- /.box -->
    </section>    <!-- /.content -->
  </div>  <!-- /.content-wrapper -->
 
 
  <?php $this->load->view('app_3widc/vf_3widc'); ?>

 

 

 

error----------------------------------------------------------------------------------------------------------------------

Uncaught TypeError: $(...).dataTable is not a function
    at loadDataTable (datatables.js:141)
    at HTMLTableElement.<anonymous> (datatables.js:59)
    at Function.each (jquery.min.js:2)
    at w.fn.init.each (jquery.min.js:2)
    at HTMLDocument.<anonymous> (datatables.js:52)
    at j (jquery-1.11.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:2)
    at Function.ready (jquery-1.11.1.min.js:2)
    at HTMLDocument.J (jquery-1.11.1.min.js:2)

 

 

tries---------------------------------------------------------

add all jquery loads at the end of adminlte "after jquery was loaded"

 

 

<!-- jQuery 3  -->
<script src="<?php echo base_url();?>assets/adminlte/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url();?>assets/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url();?>assets/adminlte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="<?php echo base_url();?>assets/adminlte/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url();?>assets/adminlte/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url();?>assets/adminlte/dist/js/demo.js"></script>
<!--
      GROCERY CRUD 
      <script src="<?php echo base_url();?>assets/grocery_crud/js/jquery-1.11.1.min.js"></script>
-->
<script src="<?php echo base_url();?>assets/grocery_crud/js/common/list.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.10.3.custom.min.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/themes/datatables/js/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/themes/datatables/js/datatables-extras.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/themes/datatables/js/datatables.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/themes/datatables/extras/TableTools/media/js/ZeroClipboard.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/themes/datatables/extras/TableTools/media/js/TableTools.min.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/jquery.fancybox-1.3.4.js"></script>
<script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/jquery.easing-1.3.pack.js"></script>

 

 

 

Any ideas?

im not developer but i will try to answer all your questions to anyone interested in help me

 

best regards