I have a view of fields in the table format, but a certain field has multiple values (the first value is $, second is £).
Is there a way in which by clicking the label "Price" or a button next to it (similar to a sort icon) would toggle between all the $ values showing then £ values showing?

Item Price
item1 $59.99, £39.99
item2 $49.99, £34.99

Comments

ravi.kumar88’s picture

As you want to toggle the values this can be handled by jQuery.Please follow these steps to acheive the functionality:
1. Goto settings of the "Price" field and under the "Multiple field setting" select display type as unordered list.
2. Create a Global:PHP field make it "Exclude from display" and under the output code write the following code.Please check the classes according to your view.

drupal_add_js('jQuery(document).ready(function(){
  jQuery(".item-list ul .first").show();
  jQuery(".item-list ul .last").hide();
  jQuery(".item-list ul .first").css({"list-style":"none"}); 
  jQuery(".item-list ul .last").css({"list-style":"none"}); 
  jQuery("thead .views-field-field-price").click(function(){
     jQuery(".item-list ul .first").toggle();
     jQuery(".item-list ul .last").toggle();
    });
 
});','inline');
mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)