ZF-6048: JQuery Slider reset to 0 with the default change event

Issue Type: Bug Created: 2009-03-17T10:07:55.000+0000 Last Updated: 2009-06-11T01:25:41.000+0000 Status: Resolved Fix version(s): - 1.8.4 (23/Jun/09)

Reporter: Yanick Rochon (yanick) Assignee: Benjamin Eberlei (beberlei) Tags: - ZendX_JQuery

Related issues: - ZF-6126



When adding a JQuery slider form element, the slider will reset itself to 0 when the 'change' event is called. The fault line is

<pre class="literal">
   $sliderUpdateFn .= sprintf('    %s("#%s").attr("value", %s("#%s-slider").slider("value", %d));'.PHP_EOL,

when the last %d is simply removed, the bug doesn't repeat itself and everyone is happy!

<pre class="literal">
   $sliderUpdateFn .= sprintf('    %s("#%s").attr("value", %s("#%s-slider").slider("value"));'.PHP_EOL,

I actually don't know why that last %d is there as it is replaced by the handle index ($i) in the for... loop.

...or perhaps I am missing the point, but removing the last %d surely solve this problem.


Posted by Yanick Rochon (yanick) on 2009-03-19T14:16:27.000+0000

An update ot the API, .slider("value", 0) sets the slider to 0 and return it (0). While .slider("value") simply returns the slider value.

Moreover, the line mentionned above may be replaced by this one

<pre class="literal">
   $sliderUpdateFn .= sprintf('    %s("#%s").attr("value", ui.value);'.PHP_EOL,

which is clearer and cleaner.

Posted by Benjamin Eberlei (beberlei) on 2009-03-25T10:28:00.000+0000

I'll handle the issue as follows, in 1.8 the jQuery requirements will be raised to 1.3 and UI 1.7 for the CDN access. I'll fix this bug for 1.8 then and offer a backwards compability mode (somehow), by introducing a version value on the jQuery helper, which is used for comparisons of this kind.

Posted by Benjamin Eberlei (beberlei) on 2009-06-11T01:25:32.000+0000

Bug is fixed in trunk and merged back into 1.8 release branch.


<pre class="highlight">

to decide which javascript generation mode should be enabled for the request. The Slider then generates the correct Javascript depending on your library version.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.