Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how dynamic set defaultValues and bounds for jqrangeslider #204

Open
Seamless2014 opened this issue Nov 17, 2015 · 2 comments
Open

how dynamic set defaultValues and bounds for jqrangeslider #204

Seamless2014 opened this issue Nov 17, 2015 · 2 comments

Comments

@Seamless2014
Copy link

Hello,
I Use JQRangesilder plug-in,at first,I can dynamic set defaultvalue and bounds,position of defaultvalue is right, however,while ,in ipad, the dateslider not work,so,I Introduce some js files,like these:<script src="/../../../jQRangeSliderMouseTouch.js" type="text/javascript"></script>

<script src="/../../../jQRangeSliderDraggable.js"></script> <script src="/../../../jQRangeSliderHandle.js"></script> <script src="/../../../jQRangeSliderBar.js"></script> <script src="/../../../jQRangeSliderLabel.js"></script> <script src="/../../../jQRangeSlider.js"></script>

Uploading set defaultValue and bounds.png…

<script src="/../../../jQDateRangeSliderHandle.js"></script> <script src="/../../../jQDateRangeSlider.js"></script>

the position of defaultvalue is not right,
please look at this link:
http://www.mlsensight.com/heatmap/crdev/drawCharts_touch.html?c=RG91Z2xhcw==&m=MzI=&sc=MTAwMTQsMTAwMTN8MTAwMTEs&mk=U1BMUE1B&tp=Y291bnR5&istp=MA==&vtmark=MA==&slc=MQ==&sLb=MQ==&tk=&cd=&sT=MQ==&sl=MQ==&t=MTI=&SelectYear=2015&SelectMonth=11&pc=MA==&isSendEmail=MA==&uid=R2VvamV0&stack=1&isTool=MQ==&ishideicon=1&selectedma=MA==&tws=&twe=&isshareembed=MA==&isshowmom=MA==&isshareori=MA==&isauto=MQ==&wd=OTMw&ht=Mzcw

in ipad, the date slider can work,but the position of defaultValue is wrong。
how to set the options ?
$.widget("ui.dateRangeSlider", $.ui.rangeSlider, {
options: {
//bounds: {min: new Date(2010,0,1).valueOf(), max: new Date(2012,0,1).valueOf()},
//defaultValues: {min: new Date(2010,1,11).valueOf(), max: new Date(2011,1,11).valueOf()}
bounds:{min:null,max:null},//tempMinBound,tempMaxBound,defaultMaxValue,defaultFromDate
//defaultValues:{min:null,max:getLastDay(parseInt(new Date().getFullYear()),new Date().getMonth()+1)}
defaultValues:{min:null,max:getLastDay(parseInt(CurrentYear),CurrentMonth)}//getLastDay(parseInt(CurrentYear),CurrentMonth)
},

Thanks

A developer

@ghusse
Copy link
Owner

ghusse commented Nov 19, 2015

If you want to set values after initialization, you have to use values and not defaultValues

@ghusse
Copy link
Owner

ghusse commented Nov 20, 2015

Hi,

  1. Don't use valueOf() on dates.
  2. Use the constructor as described in the docs :
    https://ghusse.github.io/jQRangeSlider/documentation.html#quickStart

On Tue, Nov 17, 2015 at 10:05 AM, Seamless2014 [email protected]
wrote:

Hello,
I Use JQRangesilder plug-in,at first,I can dynamic set defaultvalue and
bounds,position of defaultvalue is right, however,while ,in ipad, the
dateslider not work,so,I Introduce some js files,like these:

Uploading set defaultValue and bounds.png…

the position of defaultvalue is not right,
please look at this link:

http://www.mlsensight.com/heatmap/crdev/drawCharts_touch.html?c=RG91Z2xhcw==&m=MzI=&sc=MTAwMTQsMTAwMTN8MTAwMTEs&mk=U1BMUE1B&tp=Y291bnR5&istp=MA==&vtmark=MA==&slc=MQ==&sLb=MQ==&tk=&cd=&sT=MQ==&sl=MQ==&t=MTI=&SelectYear=2015&SelectMonth=11&pc=MA==&isSendEmail=MA==&uid=R2VvamV0&stack=1&isTool=MQ==&ishideicon=1&selectedma=MA==&tws=&twe=&isshareembed=MA==&isshowmom=MA==&isshareori=MA==&isauto=MQ==&wd=OTMw&ht=Mzcw

in ipad, the date slider can work,but the position of defaultValue is
wrong。
how to set the options ?
$.widget("ui.dateRangeSlider", $.ui.rangeSlider, {
options: {
//bounds: {min: new Date(2010,0,1).valueOf(), max: new
Date(2012,0,1).valueOf()},
//defaultValues: {min: new Date(2010,1,11).valueOf(), max: new
Date(2011,1,11).valueOf()}

bounds:{min:null,max:null},//tempMinBound,tempMaxBound,defaultMaxValue,defaultFromDate
//defaultValues:{min:null,max:getLastDay(parseInt(new
Date().getFullYear()),new Date().getMonth()+1)}

defaultValues:{min:null,max:getLastDay(parseInt(CurrentYear),CurrentMonth)}//getLastDay(parseInt(CurrentYear),CurrentMonth)
},

Thanks

A developer


Reply to this email directly or view it on GitHub
#204.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants