After 3 days, I haven't found the solution, even by programmatically.
Then what I had the last option(in my mind, huh) is,
- I get all the fields in one block only, not creating the different blocks for different tab or buttons.
- Used the description of Better Exposed Filters, in which I pasted my buttons/tab UI HTML as its.
- Now on changing the language all the fields are fetched according to the selected language. But in this case my active tab/button get lost its activeness.
- Now, I need to get the last active tab/buuton, so that I can click it again to get the active tab after filtering my languages.
Below is the piece of code which is need to my js file
.
// Active target element to make the tab/button active after
// ajax responds in filter
var activeTargetElement;
Drupal.behaviors.events = {
attach: function (context, settings) {
$('#views-exposed-form-MY_VIEW_MACHINE_NAME-BLOCK_NAME', context).ajaxStart(function () {
// my tabs/button are active on the basis of data-target attribute,
// so need to memorise which tab/button is active before fitering any language
activeTargetElement = $('#MY_TABS li.active a').data('target');
}).ajaxSuccess(function () {
// if any target is memorised, then simply click it or trigger a click event for it
if($('[data-target="'+activeTargetElement+'"]').length){
$('[data-target="'+activeTargetElement+'"]').click();
}
});
}
};