Flatpickr - Laravel
Hi
I'm having trouble implementing Flatpickr in my form, it says :
Uncaught TypeError: $(...).flatpickr is not a function
Metronic Version 8.0.38
already on mixmanifest.json "/demo1/plugins/custom/flatpickr/flatpickr.bundle.js": "/demo1/plugins/custom/flatpickr/flatpickr.bundle.js",
Replies (4)
I already tried the following
If you’re using a bundler, e.g. webpack, you’ll need to import flatpickr.
// commonjs
const flatpickr = require("flatpickr");
// es modules are recommended, if available, especially for typescript
import flatpickr from "flatpickr";
as the documentation mentions (https://flatpickr.js.org/getting-started/)
can someone support me?
Greetings
Hi Jesus,
Sorry for the delay.
The file should be there, public/demo1/plugins/custom/flatpickr/flatpickr.bundle.js
But you have to include it on your page.
For example using page config;
config/global/pages.php
'assets' => array(
'custom' => array(
'js' => array(
'plugins/custom/flatpickr/flatpickr.bundle.js'
),
),
),
Thanks
'test' => [
'title' => 'Test',
'assets' => [
'custom' => [
'css' => [
'plugins/custom/flatpickr/flatpickr.bundle.css'
],
'js' => [
'plugins/custom/flatpickr/flatpickr.bundle.js',
'js/custom/lot/test.js',
],
],
],
],
This does not work need urgent help,
i am trying to call flatpicker form the test.js