How To Create Price Slider Feature Using Ajex?

hello friends…

i want to create a price slider or range of price search feature from database using ajex filter.

i show this feature in price list filter .

i want to do same…

please give me some suggestion.how to do it?

thanks in advance…

Did You try with CJuiSlider ?

Example of usage http://yii-booster.clevertech.biz/jquery.html#slider

thanks mirunho…

now i use CJuiSlider.




		<?php

$this->widget('zii.widgets.jui.CJuiSlider', array(

'options'=>array(

'min'=>500,

'max'=>50000,

'range'=>true,

'values'=>array(5, 20)

),

));

?>	



it gives the slider but i have one problem ,how is it connect to price range from the database in the form?

You would need to bind the change event on the slider to an ajax query to retrieve the new data.

http://api.jqueryui.com/slider/#event-change

Something like this (not tested, haven’t used CJuiSlider, but may point you in the right direction).


<?php

$this->widget('zii.widgets.jui.CJuiSlider', array(

    'options'=>array(

        'min'=>500,

        'max'=>50000,

        'range'=>true,

        'values'=>array(5, 20)

        'change'=>CJavaScriptExpression("function( event, ui ) { 

                                              $.get('/whatever/url',

                                                     {values: this.values()}, 

                                                     function(data) { $('#something').replace(data); }

                                              );

                                         }")

    ),

));

?>

HI friends…

please explain this code…

how to work it?




		  <?php

$this->widget('zii.widgets.jui.CJuiSlider', array(

'value' => $model->product_id,

'id' => 'masterIndex',

// additional javascript options for the slider plugin

'options' => array(

'min'=>500,

'max'=>50000,

'range'=>true,

'values'=>array(500, 2000),

'slide'=>'js:function(event, ui) { $("#price").val(ui.value);}', 

                            ),

'htmlOptions' => array(

 'style' => 'height:8px;width:140px;',

 'class'=>'masterIndexFilter'

                            ),

                        ));

                    ?>	



how to slider takes the value from the database?

hello…

anyone…

pls suggest me how to implement price slider search in yii?

thanks…

http://www.yiiframework.com/forum/index.php/topic/13441-cjuislider-extended-javascript-functions/page__p__65979__hl__CJuiSlider+form#entry65979

looks like something that You need.

We cant implement it for You.