I am using Bootstrap theme. For some reason, the Date time picker is not showing. its a plain text box which has "Clear (dd/mm/yyyy) hh:mm:ss" written below it. Please help.
⚠ 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. ⚠
Posted 22 August 2015 - 02:29 AM
I am using Bootstrap theme. For some reason, the Date time picker is not showing. its a plain text box which has "Clear (dd/mm/yyyy) hh:mm:ss" written below it. Please help.
Posted 23 August 2015 - 03:16 AM
do check in the firebug / developer console if there is any javascript error / issue thats there
also possible, there might be some scripts missing in the path. Check and see if any such things are there or not - if yes - fix them and it might work for you.
Posted 24 August 2015 - 03:48 AM
TypeError: $(...).datepicker is not a function grocery crud
This is the error Im getting.. Couldnt get any solution for it yet.
Posted 24 August 2015 - 08:37 AM
Well.. do one thing.. view the generated source - check if there are multiple instance of jquery being loaded .. if yes - this causes the problem..
if yes - do an $crud->unset_jquery() .... it should solve the issue...
check the same for jquery_ui...
if same exists double ... unset_jqueryui();
checkout the function reference in crud api list.. if i may have made mistake
Posted 24 August 2015 - 13:05 PM
Thanks Amit. I tried unsetting but still no success.
This is my controller:
public function _example_output($output = null){
$this->load->view('example.php',$output);
$this->load->view('pages/button_view.php');
}
public function new_user_employment(){
$this->load->library('session');
$userid = $_SESSION['logged_in']["user_profile_id"];
$this->load->library('grocery_CRUD');
$this->load->database();
$this->load->helper('url');
$crud = new grocery_CRUD();
$this->load->view('templates/header.php');
$this->output->append_output("<h2>Registration Form - Employment Details</h2>");
$crud->set_theme('bootstrap');
$crud->set_subject('Employment Details');
$crud->set_table('user_employment_details');
$crud->set_relation('user_profile_id','user_profile','id');
$crud->where('user_profile_id',$userid);
//$crud->callback_before_insert(array($this,'user_callback'));
$crud->required_fields('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email');
$crud->set_relation('country','country','country_name');
$crud->columns(array('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email'));
$crud->add_fields(array('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email'));
$crud->edit_fields(array('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email'));
$crud->change_field_type('user_profile_id','invisible');
$crud->change_field_type('added_on','invisible');
$crud->change_field_type('added_by','invisible');
$crud->change_field_type('updated_by','invisible');
$crud->unset_export();
$crud->unset_print();
$crud->unset_jquery_ui();
$crud->unset_jquery();
$crud->callback_insert(array($this,'insert_employment'));
$output = $crud->render();
$this->_example_output($output);
}
function insert_employment($post_array) {
$user_employment_insert = array(
"user_profile_id" => $_SESSION['logged_in']["user_profile_id"],
"company_name" => $post_array["company_name"],
"title" => $post_array["title"],
"date_from" => date('Y-m-d H:i:s', strtotime($post_array["date_from"])),
"date_to" => date('Y-m-d H:i:s', strtotime($post_array["date_to"])),
"address1" => $post_array["address1"],
"address2" => $post_array["address2"],
"city" => $post_array["city"],
"state" => $post_array["state"],
"zip" => $post_array["zip"],
"country" => $post_array["country"],
"work_email" => $post_array["work_email"],
"added_on" => date('Y-m-d H:i:s'),
"added_by" => 'Web Registration',
"updated_by" => 'Web Registration'
);
// print_r($user_employment_insert);
// exit();
return $this->db->insert('user_employment_details',$user_employment_insert);
}
// END - Store employment data in database -Author/Reviewer
i have three such functions in the same controller.
Posted 24 August 2015 - 19:03 PM
well.. theres nothing wrong with the code.. its technically to do with some javascript thats overriding each other or not functioning as expected... i will like to have access to the js version where i may be able to guide you where things may be going wrong!
Posted 26 August 2015 - 01:42 AM
what do you mean js version?
Posted 26 August 2015 - 02:34 AM
its definitely a jquery issue. since the cancel button, save and go back button, full screen button, date time picker are not working. i want to include an image of the firebug. but i dont know how to..
Posted 26 August 2015 - 11:30 AM
can u upload the same on some staging server and share the urls.. this conversation can go private if required. U can pm me the urls if u hesitate to share the stuff..on public. I recently encountered - where i was adopting the gc into the existing theme which had jquery included and along with the same, a certain other scripts that depended on it. That i saw had like a version 1.9
GC on other hand loaded 1.10.+ some version .. now if i did unset_jquery - .. it worked fine with the other extensions but on submit - showed me the message... if i didnt unset the jquery from crud - the plugins at bottom failed due to the version clash...
so i replaced the themes jquery with the gc's jquery - and unset crud's jquery ... then it worked fine and as expected.
Strange but true.. this happens..