Zend Framework

Zend_Dojo_Form_Element_NumberSpinner is not supporting decimal deltas

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.10.6
  • Fix Version/s: 1.11.6
  • Component/s: Zend_Dojo
  • Labels:
    None

Description

It is not possible to increment/decrement values in steps less than 1 in a dojo numberspinner.

The setSmallDelta method from Zend_Dojo_Form_Element_NumberSpinner currently takes as parameter an int value for delta, which is causing this mis-behaviour. Hence specifying any decimal value will be casted to int.

Also setting smallDelta to a decimal value in an options array to be used in setOptions method doesn't work (i assume the options is somehow translated to a setSmallDelta call)

Current workaround is to set the dijit parameter explicitly like this:
$formelement->setDijitParam('smallDelta', 0.01);

Trivial correction is to change the setSmallDelta parameter type from int to float.

  1. ZF-10331.diff
    22/Apr/11 10:45 PM
    1 kB
    Robert Basic
  2. ZF-10331-tests.diff
    22/Apr/11 10:45 PM
    1 kB
    Robert Basic

Activity

Hide
Robert Basic added a comment -

Patch and tests for this issue. Can set small and large deltas to decimal values and min and max values to decimal.

Show
Robert Basic added a comment - Patch and tests for this issue. Can set small and large deltas to decimal values and min and max values to decimal.
Hide
Matthew Weier O'Phinney added a comment -

Patches applied to trunk and 1.11 release branch.

Show
Matthew Weier O'Phinney added a comment - Patches applied to trunk and 1.11 release branch.
Hide
Robert Basic added a comment -

Pull request for porting the patch in ZF2 is sent: https://github.com/zendframework/zf2/pull/270

Show
Robert Basic added a comment - Pull request for porting the patch in ZF2 is sent: https://github.com/zendframework/zf2/pull/270

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: