EasyUI Forum

General Category => Bug Report => Topic started by: rickmus on January 21, 2017, 12:03:35 PM



Title: Updating Sliders causes error during click
Post by: rickmus on January 21, 2017, 12:03:35 PM
I need to update the slider's min/max as the area they represent is dynamic.  Normally if I do an update an the user isn't about to click the slider to start sliding, all is good.  But if you happen to do an update around the same time the user is pressing the button over the slider knob, you will get the errors below.  This is using 1.5.1 and prior version 1.4.x also exhibited the same error.

      $( "#map_vertical_scroll" ).slider( {
         min: 0,
         max: this.m_ScrollBounds.m_flBoundsHeight,
      } );

jquery.easyui.min.js:445 Uncaught TypeError: Cannot read property 'options' of undefined
    at _43 (jquery.easyui.min.js:445)
    at jquery.easyui.min.js:638
_43 @ jquery.easyui.min.js:445

(anonymous) @ jquery.easyui.min.js:638
jquery.easyui.min.js:389 Uncaught TypeError: Cannot read property 'options' of undefined
    at _39 (jquery.easyui.min.js:389)
    at HTMLDocument._49 (jquery.easyui.min.js:483)
    at HTMLDocument.dispatch (jquery.min.js:4)
    at HTMLDocument.r.handle (jquery.min.js:4)


Title: Re: Updating Sliders causes error during click
Post by: stworthy on January 22, 2017, 12:28:24 AM
If you only want to change the 'max' value, please call this code instead.
Code:
$('#ss').slider('options').max = 50;
$('#ss').slider('resize');


Title: Re: Updating Sliders causes error during click
Post by: rickmus on January 30, 2017, 01:09:43 PM
That worked, thank you!