Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Scroll Wheel Numbers in 5.3

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-05-2017, 08:24 PM
 
kirkbauer kirkbauer is offline
 

Member
  
Join Date: Dec 2015
Posts: 26
 

Default 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?
__________________
X-Cart Business 5.3.6.8
Reply With Quote
  #2  
Old 02-06-2017, 07:03 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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...
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 02-06-2017, 07:58 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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.
__________________
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
Reply With Quote

The following 2 users thank qualiteam for this useful post:
kirkbauer (02-06-2017), totaltec (02-06-2017)
  #4  
Old 02-06-2017, 09:15 AM
 
kirkbauer kirkbauer is offline
 

Member
  
Join Date: Dec 2015
Posts: 26
 

Default 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; class Numeric extends \XLite\View\FormField\Input\Text\Base\Numeric { public function __construct(array $params = array()) { static::PARAM_MOUSE_WHEEL_CTRL = true; parent::__construct($params); } }
__________________
X-Cart Business 5.3.6.8
Reply With Quote
  #5  
Old 02-12-2017, 11:48 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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:
namespace XLite\Module\KB\TDT\View\FormField\Input\Text\Base;

class 
Numeric extends \XLite\View\FormField\Input\Text\Base\Numeric implements \XLite\Base\IDecorator
{
    protected function 
getDefaultMouseWheelCtrlValue()
    {
        return 
true;
    }

__________________
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

Last edited by qualiteam : 02-12-2017 at 11:51 PM.
Reply With Quote
  #6  
Old 02-12-2017, 11:53 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Scroll Wheel Numbers in 5.3

yeah, that makes sense *cough*
__________________
xcartmods.co.uk
Reply With Quote
  #7  
Old 02-13-2017, 05:26 AM
 
kirkbauer kirkbauer is offline
 

Member
  
Join Date: Dec 2015
Posts: 26
 

Default Re: Scroll Wheel Numbers in 5.3

That solution worked perfectly; thank you!
__________________
X-Cart Business 5.3.6.8
Reply With Quote
  #8  
Old 02-13-2017, 05:42 AM
 
ITVV ITVV is online now
 

X-Wizard
  
Join Date: Nov 2006
Location: UK
Posts: 1,164
 

Default Re: Scroll Wheel Numbers in 5.3

Quote:
Originally Posted by PhilJ
yeah, that makes sense *cough*
LOL
__________________
X-Cart Pro 4.7.12 Active and working great with reBOOT-reDUX
X-Cart Pro 4.6.6 Retired after 6 years of first class service
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Apache: 2.4.25
PHP: 7.4.5
MariaDB: 10.1.44
Arch: x86_64
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:16 PM.

   

 
X-Cart forums © 2001-2020