Last active
December 17, 2015 13:10
-
-
Save brobertsaz/5615368 to your computer and use it in GitHub Desktop.
changing table rows with jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.activity-log-header | |
%p.low | |
Refine results by Organization | |
%p | |
= select_tag 'search[query]', options_for_select(@organizations), class: 'chosen-select', prompt: "Search for organization to select", id: 'org-selection' | |
.activity_log_results | |
%table.fancy-table | |
%thead | |
%tr | |
%th Date | |
%th Time | |
%th Organization Name | |
%th Event | |
- @stream_events.desc(:time).each do |event| | |
%tbody | |
%tr{class: 'filtered-row'} | |
%td | |
= event.time.strftime("%Y-%m-%e") | |
%td | |
= event.time.strftime("%H:%M:%S") | |
%td{class: "#{event.organization.name_city_state}"} | |
- if event.organization | |
= event.organization.name_city_state | |
%td | |
= event.description | |
:javascript | |
$("#org-selection").click(function() { | |
$('.filtered-row').hide(); | |
$(this.value).show(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment