DatePicker input on my Form Field
1 Attachment(s)
Hello, I want that one of my input fields in form show a datepicker. I use this class when i define my field, but it doesn't work.
'date' => [ self::SCHEMA_CLASS => '\XLite\View\FormField\Inline\Input\Text\Date', self::SCHEMA_LABEL => static::t('Date'), self::SCHEMA_PLACEHOLDER => static::t('Date'), self::SCHEMA_REQUIRED => true, ], |
Re: DatePicker input on my Form Field
Hi Alex,
Try to use \XLite\View\FormModel\Type\DatepickerType as self::SCHEMA_CLASS. Tony Quote:
|
Re: DatePicker input on my Form Field
If i use \XLite\View\FormModel\Type\DatepickerType, I get this error :
Call to undefined method XLite\View\FormModel\Type\DatepickerType::checkVis ibility() |
Re: DatePicker input on my Form Field
Quote:
Could you please send the full error message with backtrace? You might need to look it up in X-Cart logs. Tony |
Re: DatePicker input on my Form Field
[20-Apr-2018 12:45:36] Error (code: 0): Call to protected method XLite\View\FormModel\Type\DatepickerType::checkVis ibility() from context 'XLite\View\Model\AModel'
Server API: cgi-fcgi; Request method: GET; URI: /?target=return_form; |
Re: DatePicker input on my Form Field
Try this:
PHP Code:
|
Re: DatePicker input on my Form Field
It return me this exception :
Unable to find template "form_field/datepicker.twig" (looked into: /storage/web/ecarnaval/public_html/skins/crisp_white/customer, /storage/web/ecarnaval/public_html/skins/custom_skin/customer, /storage/web/ecarnaval/public_html/skins/customer, /storage/web/ecarnaval/public_html/skins/common) in "form_field/form_field.twig" at line 20. |
Re: DatePicker input on my Form Field
@Alex,
Yes, datepicker widget is not designed to work in customer area, only in admin back-end. If you want to make it working in customer zone, you need to create your own version of this class. Basic plan should be as follows: - Extend\XLite\View\DatePicker class in your module; - Define your own versions of getJSFiles(), getCSSFiles() and getFieldTemplate() methods, so that they would use files from customer area; - Use your class in your ItemsList. |
Re: DatePicker input on my Form Field
Quote:
Ok. I try to create my own class. |
Re: DatePicker input on my Form Field
1 Attachment(s)
Quote:
My custom class render in my view such this result as in capture. What is wrong ? This is my schemaDefault : 'date' => [ self::SCHEMA_CLASS => '\XLite\Module\Fdmteam\Xretur\View\FormField\Input \Text\DatePicker', self::SCHEMA_LABEL => static::t('Date'), self::SCHEMA_PLACEHOLDER => static::t('Date'), self::SCHEMA_REQUIRED => true, ], |
All times are GMT -8. The time now is 12:47 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.