How to resolve Uncaught TypeError: Cannot read property 'timepicker' of undefined

3.1k Views Asked by At

I tried all the answers to resolve this error, but it's not working.

This is my controller:

import_file($this->css, 
            array('colorbox.css', 
                  'jquery.timepicker.css',
                  'calender/default.css', 
                  'calender/default.time.css',
                  'calender/default.date.css', 
                  'responsive-tables.css'));

import_file($this->javascript, 
            array('jquery.colorbox.js',
                  'jquery.ui.js', 
                  'jquery.timepicker.js', 
                  'jquery-ui-timepicker-addon.js', 
                  'responsive-tables.js',
                  'calender/picker.js',
                  'calender/picker.date.js',
                  'calender/picker.time.js', 
                  'calender/legacy.js', 
                  'calender/calender.js',
                  'scheduler.js',
                  'customer.js'));

This is the error part:

$.ui.timepicker = $.ui.timepicker || {};
if ($.ui.timepicker.version) {
    return;
}

Is there any other way to resolve this error?

1

There are 1 best solutions below

3
On

I did not see jquery.min.js file in your code. Please include jquery.min.js as the first one.