加载页面时杂货Crud出错

时间:2014-03-04 12:19:09

标签: php codeigniter grocery-crud

错误:

Fatal error: Call to undefined method grocery_CRUD::set_js_lib() in assets/grocery_crud/themes/custom_checkbox_flexigrid/views/list_template.php on line 3

代码:

$this->set_css($this->default_theme_path.'/custom_checkbox_flexigrid/css/flexigrid.css');
$this->set_js_lib($this->default_javascript_path.'/'.grocery_CRUD::JQUERY);

$this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js');
$this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js');
$this->set_js_lib($this->default_javascript_path.'/common/lazyload-min.js');

if (!$this->is_IE7()) {
    $this->set_js_lib($this->default_javascript_path.'/common/list.js');
}

$this->set_js($this->default_theme_path.'/custom_checkbox_flexigrid/js/cookies.js');
$this->set_js($this->default_theme_path.'/custom_checkbox_flexigrid/js/flexigrid.js');
$this->set_js($this->default_theme_path.'/custom_checkbox_flexigrid/js/jquery.form.js');
$this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.numeric.min.js');
$this->set_js($this->default_theme_path.'/custom_checkbox_flexigrid/js/jquery.printElement.min.js');

/** Fancybox */
$this->set_css($this->default_css_path.'/jquery_plugins/fancybox/jquery.fancybox.css');
$this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.fancybox-1.3.4.js');
$this->set_js($this->default_javascript_path.'/jquery_plugins/jquery.easing-1.3.pack.js');

/** Jquery UI */
$this->load_js_jqueryui();

?>

在控制器页面中,我使用以下代码:

$crud = new grocery_CRUD();
                 $crud->unset_jquery();
        $crud->set_table('table name');
        $crud->display_as('userName','User name')->display_as('userEmail','User email')->display_as('aboutMe','About me')->display_as('donateDate','Donate date')->display_as('signUpDate','Signup date');
        $crud->set_theme('custom_checkbox_flexigrid');
        $crud->change_field_type('status','true_false');
        $crud->unset_add();
        //$crud->unset_delete();
        $crud->unset_export();
        $crud->unset_print();
        $crud->unset_columns('userpassword','albumOrder','albumsPerPage','albumsPerPageAdmin','friendsPerPage','keepUpdated','sendAdminUpdates','userType');
        $crud->edit_fields('userName','userEmail','aboutMe','status');
        $output =$crud->render();
        $css_files=array();
        $js_files=array();
        $css_files=array_merge($css_files,$output->css_files);
        $js_files=array_merge($js_files,$output->js_files);
        $title="Search users";
        $head_data = array('username'=>'','last_login'=>'','js_files' =>$js_files, 'css_files' =>$css_files,'title'=>$title);
        $body_data=array('output' => $output->output);
        $this->load->view('admin/header',$head_data);
        $this->load->view('admin/searchuser',$body_data);
        $this->load->view('admin/footer');

杂货店使用该页面显示相同的错误。 如果我尝试添加$ crud-> unset_jquery();我显示相同的错误

还添加 $ crud-> set_js_lib( '管理员/资产/ grocery_crud / JS /' grocery_CRUD :: JQUERY);                      $ crud-> set_default_javascript_path( '管理员/资产/ grocery_crud / JS'); 它显示了皇帝所以我评论这两行并添加unset_jquery但没有效果,同样的错误

1 个答案:

答案 0 :(得分:0)

尝试在您的代码中使用它。

$crud = new grocery_crud(); $crud->unset_jquery();