I had a similar problem and my solution was to write a custom query that fetches distinct values from the desired tables in ascending order & populating the slider with the query's result. Here are the steps:
1.
In the .module file of your custom module,
function <module_name>_preprocess_views_view(&$vars)
{
$view = $vars['view'];
$query = $view->query;
//Use this to find out the machine name of view
//drupal_set_message('<pre>' .print_r($view->name,TRUE). '</pre>');
switch($view->name)
{
case '<view_name>':
//Fetch distinct price values from the price table(s) & sort in ascending order since a slider ranges from min to max!
$arr = db_query("SELECT DISTINCT column1_value FROM {price_table1},{price_table2} ORDER BY column1_value ASC")->fetchCol();
//Convert associative arrays to normal arrays
foreach($arr as $key=>$value)
$normal_arr[] = (float)$value;
//Pass variables from .module to .js file
drupal_add_js(
array(
'views_slider' => array(
'arr_values' => $normal_arr
)
),
array('type' => 'setting')
);
//Include appropriate .js file
drupal_add_js(drupal_get_path('module', '<module_name>') . '<path_to_js_file_within_module>/<js_file>.js');
break;
}
}
2.
In the .js file, populate the jQuery slider using the result of the query as reference. Cookies are used to retrieve values on the slider & its textboxes even after page load/views exposed form submit.
function ($) {
Drupal.behaviors.views_slider = {
attach: function (context, settings) {
var arr_val = Drupal.settings.views_slider.arr_values;
var min = getCookie("price-min");
var max = getCookie("price-max");
//Here 'edit-field-price-value-wrapper' is the id of the BEF slider wrapper.
//You can find this by using Firebug or similar element-inspecting browser apps.
$("div#edit-field-price-value-wrapper div.ui-slider").slider({
min: 0,
max: arr_val.length-1,
values:[min, max],
slide: function(event, ui) {
if (ui.values[0] > ui.values[1])
{
return false;
}
$("#edit-field-price-slider-value-min").val(arr_val[ui.values[0]]); //Id of min textbox in BEF slider
$("#edit-field-price-slider-value-max").val(arr_val[ui.values[1]]); //Id of max textbox in BEF slider
setCookie("price-min", ui.values[0], 1);
setCookie("price-max", ui.values[1], 1);
},
//When incorrect values are entered,this event updates the textboxes to their closest value
change: function (event, ui) {
if (ui.values[0] > ui.values[1])
{
return false;
}
$("#edit-field-price-slider-value-min").val(arr_val[ui.values[0]]); //Id of min textbox in BEF slider
$("#edit-field-price-slider-value-max").val(arr_val[ui.values[1]]); //Id of max textbox in BEF slider
setCookie("price-min", ui.values[0], 1);
setCookie("price-max", ui.values[1], 1);
}
});
}
}
})(jQuery);
Hope this helps.