1 // http://civicrm.org/licensing
8 chart_view: function() {
9 var chartUrl
= CRM
.url("civicrm/ajax/chart", {
11 'year': $('#select_year').val() || new Date().getFullYear(),
12 'type': $('#chart_type').val() || 'bvg'
14 $("#chartData").load(chartUrl
, function() {
15 $("select", "#chartData").change(load
.chart_view
);
18 table_view: function() {
19 var tableUrl
= CRM
.url("civicrm/contribute/ajax/tableview", {showtable
: 1, snippet
: 4});
20 $("#chartData").load(tableUrl
);
24 $('#chart_view, #table_view').click(function() {
25 if ($(this).hasClass('ui-state-default')) {
26 $('.ui-tabs-selected', '#mainTabContainer').removeClass('ui-state-active ui-tabs-selected').addClass('ui-state-default');
27 $(this).removeClass('ui-state-default').addClass('ui-state-active ui-tabs-selected');
32 // Initialize chart or table based on url hash
33 if (window
.location
.hash
=== '#table_layout') {
34 $('#table_view').click();