| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
DatePicker input on my Form Field | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
DatePicker input on my Form Field
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, ],
__________________
Soptareanu Alex |
|||||||
#2
|
|||||||||
|
|||||||||
Re: DatePicker input on my Form Field
Hi Alex,
Try to use \XLite\View\FormModel\Type\DatepickerType as self::SCHEMA_CLASS. Tony Quote:
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#3
|
|||||||
|
|||||||
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()
__________________
Soptareanu Alex |
|||||||
#4
|
|||||||||
|
|||||||||
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
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#5
|
|||||||
|
|||||||
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;
__________________
Soptareanu Alex |
|||||||
#6
|
|||||||||
|
|||||||||
Re: DatePicker input on my Form Field
Try this:
PHP Code:
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#7
|
|||||||
|
|||||||
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.
__________________
Soptareanu Alex |
|||||||
#8
|
|||||||||
|
|||||||||
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.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
#9
|
|||||||
|
|||||||
Re: DatePicker input on my Form Field
Quote:
Ok. I try to create my own class.
__________________
Soptareanu Alex |
|||||||
#10
|
|||||||
|
|||||||
Re: DatePicker input on my Form Field
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, ],
__________________
Soptareanu Alex |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|