I created a views
page using foo
plugin.When a user visit the page the city and Clinic/Hospital columns by default are being rendered alphabetically (ASC) as in below screenshot.
EDIT: Let’s say for example. City is Bangalore and only for Bangalore Clinic/Hospital(C/H) column is alphabetically ordered(say Hospitals A,B,C,D…).Then user clicks on City head,then for Bangalore C/H column is alphabetically disordered(ex B,D,C,H…) but records are still correct to Bangalore city means those clinic/hospitals are located in Bangalore .Same goes for other cities too.What I want is C/H col should be ordered as earlier (alphabetical) City by City but no matter how city is ordered.
When user clicks on City head (which is sortable),the order of Clinic/Hospital goes heywire (no more alphabetical order) like below image:
Problem: How can I make my Clinic/Hospital order intact even after user clicks on City head.
Below is my views
configuration:
I am using Drupal 7.41
and views 3.0
Tried so far:
function mymodule_views_query_alter(&$view, &$query) { if($view->name == 'list_of_doctors' && $view->current_display == 'page_1' && count($query->orderby) == 1) { $query->orderby[1] = array( 'field' => 'field_data_field_clinic_hospital_field_clinic_hospital_value', 'direction' => 'ASC', ); } }
}
But after clicking City head,whole table vanishes.