Scroll Wheel Numbers in 5.3
In 5.2 many integer fields (e.g. "Quantity in Stock" on the view product screen) would allow you to increment/decrement the number using the mouse scroll wheel. When you click on the field it would show a little mouse icon next to the field to indicate this.
As far as I can tell this is gone from 5.3. Any idea how to get it back? |
Re: Scroll Wheel Numbers in 5.3
I can confirm that this is missing in one of my client 5.3 versions. I can;t find any settings in the admin dealing with this. It may have been intentionally removed, or it may be a bug...
|
Re: Scroll Wheel Numbers in 5.3
It was disabled intentionally, however can be re-enabled from a custom module.
Solution #1: Decorate \XLite\View\FormField\Input\Text\Base\Numeric class from a custom module and set static::PARAM_MOUSE_WHEEL_CTRL to true. Solution #2: In templates that use this widget pass an extra parameter "mouseWheelCtrl" and set it to "true". In widget classes that add this widget to a form, pass the extra PARAM_MOUSE_WHEEL_CTRL parameter. |
Re: Scroll Wheel Numbers in 5.3
Thanks for the quick response! I'm still pretty new to X-Cart development. I tried to override globally and it didn't work, did I do something wrong here?
Code:
namespace XLite\Module\KB\TDT\View\FormField; |
Re: Scroll Wheel Numbers in 5.3
No, I meant a bit different thing.
PARAM_MOUSE_WHEEL_CTRL is a widget parameter that is set in defineWidgetParams() method. So, you should either decorate this method and set the parameter to true there, or tweak the getDefaultMouseWheelCtrlValue() method that returns the default value for the parameter. Also, when you change the behavior of an existing class ("decorate" it), you should not just create a new class extending the existing one, but also mark it with the "implements" directive like this (also see how the namespace matches the namespace of the existing class - it is not a requirement, but a good practice): PHP Code:
|
Re: Scroll Wheel Numbers in 5.3
yeah, that makes sense *cough*
|
Re: Scroll Wheel Numbers in 5.3
That solution worked perfectly; thank you!
|
Re: Scroll Wheel Numbers in 5.3
Quote:
|
All times are GMT -8. The time now is 10:51 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.