jQRangeSlider icon indicating copy to clipboard operation
jQRangeSlider copied to clipboard

how dynamic set defaultValues and bounds for jqrangeslider

Open Seamless2014 opened this issue 10 years ago • 2 comments
trafficstars

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

Seamless2014 avatar Nov 17 '15 09:11 Seamless2014

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

ghusse avatar Nov 19 '15 10:11 ghusse

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 https://github.com/ghusse/jQRangeSlider/issues/204.

ghusse avatar Nov 20 '15 08:11 ghusse