⚠ 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

ajax_list_info 500 (Internal Server Error)



CharleSven

CharleSven
  • profile picture
  • Member

Posted 26 June 2015 - 07:45 AM

First of all, thank you GroceryCRUD team for making my coding faster. Less time creating forms and datatable.

 

Currently I receive this ajax_list_info error when the page loads or I tried pressing pagination/search button. The theme I am using is flexigrid. I copy the flexigrid folder and rename it to 'sl_it_tasks'. This did not happen to me when I used the same grocery settings before I transfer the controller function to a new project. 

 

In old project, I did not hard code the js to the main page like this

  <!-- BEGIN: PAGE SCRIPTS -->
 
  <!-- jQuery -->
  <script src="<?php echo base_url();?>assets/vendor/jquery/jquery-1.11.1.min.js"></script>
  <script src="<?php echo base_url();?>assets/vendor/jquery/jquery_ui/jquery-ui.min.js"></script> 

  <!-- Bootstrap Timeout Plugin -->
  <script src="<?php echo base_url() ?>assets/vendor/plugins/bstimeout/bs-timeout.js"></script>

  <!-- Theme Javascript  -->

  <script src="<?php echo base_url();?>assets/js/utility/utility.js"></script>
  <script src="<?php echo base_url();?>assets/js/demo/demo.js"></script>
  <script src="<?php echo base_url();?>assets/js/main.js"></script>

  <!-- Grocery GRUD Specific -->
  <script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/jquery.noty.js"></script>
  <script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/config/jquery.noty.config.js"></script>
  <script src="<?php echo base_url();?>assets/grocery_crud/js/common/lazyload-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/themes/flexigrid/js/cookies.js"></script>
  <script src="<?php echo base_url();?>assets/grocery_crud/themes/flexigrid/js/flexigrid.js"></script>
  <script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/jquery.form.min.js"></script>
  <script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/jquery.numeric.min.js"></script>
  <script src="<?php echo base_url();?>assets/grocery_crud/themes/flexigrid/js/jquery.printElement.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>
  <script src="<?php echo base_url();?>assets/grocery_crud/js/jquery_plugins/ui/jquery-ui-1.10.3.custom.min.js"></script>
  
  <script type="text/javascript">
  jQuery(document).ready(function() 
  {
    "use strict";

    // Init Theme Core      
    Core.init();  
   
  });
  </script>
  <!-- END: PAGE SCRIPTS -->

Even we add some custom code within the library file Grocery_CRUD.php and within the model file grocery_crud_model.php the pagination/search was fixed. (not giving me a hard time tracing where went wrong)

 

It's been 3 days now I can not figure out how ajax_list_info related to pagination and search button. Can someone explain what ajax_list_info do? 

 

I already follow the advice on this link. /topic/238-ajax-list-not-refreshing/ with no success.

 

I am using the same database table as the old project on this code below.

 $crud = new grocery_CRUD();        
 $data = $this->_quick_info(); 
        
 $data['query'] = $query = array('data' => $this->it_tasks_model->it_tasks_selected_lists());
        
 $crud->set_theme('sl_it_tasks');       
 $crud->set_table('it_tasks');
 $crud->set_subject('Tasks');

 $crud->unset_add();
 $crud->unset_export();
 $crud->unset_print();
 $crud->unset_delete();
        
 $crud->columns('it_tasks_id', 'date_issued', 'it_tasks_title', 'description', 'status' , 'assign_id', 'originally_id');
        
 $crud->set_relation('assign_id','tb_hr','fname', array('tb_group_id' => '7', 'is_active' => '1'));

 $crud->set_relation('originally_id','tb_hr','fname', array('is_active' => '1'));

 $crud->order_by('it_tasks_id', 'desc');

 $crud->where('is_archive', 0);
 $crud->where('deleted', 0);

 $crud->display_as('it_tasks_id', 'RecID');
 $crud->display_as('date_issued', 'Issued'); 
 $crud->display_as('it_tasks_title', 'Title');       
 $crud->display_as('attach_files', 'Files');
 $crud->display_as('assign_id', 'Assign');
 $crud->display_as('originally_id', 'Origin');
 $crud->display_as('it_task_completed', 'Time completed');
 $crud->display_as('it_task_deadline', 'Completed within');

 $current_user_id = $this->session->userdata('id');
 $allowed_it_users = array(6, 31, 40);

 foreach($allowed_it_users as $allowed_it_user) 
 { 
     // chrome_log('$allowed_it_user :'.$allowed_it_user)
     if($current_user_id == $allowed_it_user)
     { 
         // $data['click_permitted']  = '';
         $crud->is_manager(); 
         // chrome_log('QA User with CRUD permission found');
     }         
 }
 $output = $crud->render();
  
 $data['output'] = json_encode($output);       
            
 $this->load->view('<to view page>', $data);

moe2801

moe2801
  • profile picture
  • Member

Posted 03 February 2016 - 16:41 PM

Hi!

 

The ajax_list_info is a function to create the SQL for the search and to return the table for the flexigrid. The real function is called set_ajax_list_queries in the Grocery_CRUD.php

 

Most likely there's a problem with the SQL/database and in order to view the error do the following:

 

1) Use Chrome (I think it works with FF too, but I only use Chrome)

2) Open the site where the error occurs.

3) Open developer options in chrome (F12)

4) Click the network tab

5) Press F5

6) Search for something press the button and watch the network tab.

7) Look for a entry in red color, press it, click on preview now you see the error

8) Paste the error here