KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

RangeSlide - Max Value #509

Open Yeshai Bouskila opened this topic on on Nov 3, 2018 - 3 comments

Yeshai Bouskila commented on Nov 3, 2018

Hello,

I'm trying to setup multiple range sliders on one page The problem i'm running into is the graphics and the slider length

In the RangeSlider.php in the inputs package there is a min/max value that changes that slider min max but it set's this for all sliders on the page... Is there a way to make this a variable based on the min/max that are setup in the view.php file for the report?

Thank you Yeshai

KoolReport commented on Nov 5, 2018

Could you please explain a little further? If you have some code, it will be better.

Yeshai Bouskila commented on Nov 5, 2018

So I'm trying to add two sliders on with min 0-50000 and the other min 0-20

                        <div class="col-md-12 form-group">
                            <label> </span></label>
                            <div class="row">
                                <div class="col-md-6">
                                    <label>Select Carats <span class="badge" style="background:#d83c3c;">New</span></label>
									<p>Values=(<?php echo number_format($this->params["diamCaratsSlider"][0]).",".number_format($this->params["diamCaratsSlider"][1]); ?>)</p>
                                    <?php
                                    RangeSlider::create(array(
                                        "name"=>"diamCaratsSlider",
                                        "handles"=>2,
                                        "ranges"=>array(
                                            "min"=>0,
                                            "max"=>20,
                                        ),
                                        "step"=>0.5,
                                        "scale"=>1,
                                    ));
                                    ?>
                                </div>
                            </div>
                        </div>
                                                        
                    </div>
					                        <div class="col-md-12 form-group">
                            <label> </span></label>
                            <div class="row">
                                <div class="col-md-6">
                                    <label>Select Price Range <span class="badge" style="background:#d83c3c;">New</span></label>
									<p>Values=(<?php echo number_format($this->params["diamCaratsSlider"][0]).",".number_format($this->params["diamCaratsSlider"][1]); ?>)</p>
                                    <?php
                                    RangeSlider::create(array(
                                        "name"=>"diamPriceSlider",
                                        "handles"=>2,
                                        "ranges"=>array(
                                            "min"=>0,
                                            "max"=>50000,
                                        ),
                                        "step"=>100,
                                        "scale"=>100,
                                    ));
                                    ?>
                                </div>
                            </div>
                        </div>

As well the values are set in the main PHP file for default params

    protected function defaultParamValues()
    {
        return array(
            "rangeSliderOne"=>array(50),
            "diamCaratsSlider"=>array(0,20),
			"diamPriceSlider"=>array(0,50000),

it seems like in the onInit function in the RangeSlider.php file it's hard coded to X and Y

        parent::onInit();

        $this->range = Utility::get($this->range,"range",array(
            "min"=>0,
            "max"=>20,
        ));

Results in off sliders

KoolReport commented on Nov 5, 2018

Let me send dev.team about your case.

About the hard-code value, it is not. The line of code there meaning that, RangSlider try to get the "range" property, if it does not exist, take the default value which is min=0 and max=20.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None