diff options
| author | anicet | 2015-06-19 18:02:55 +0200 |
|---|---|---|
| committer | anicet | 2015-06-19 18:03:10 +0200 |
| commit | 826ddf83b478ee4aa7b89a7a9873a1843f54ba48 (patch) | |
| tree | 86a359006b4e238b10d3b22f72d7b316583f8a07 /app/assets/javascripts | |
| parent | 6a7d968fb6b227ab0e4751f39d70605891185828 (diff) | |
| download | chouette-core-826ddf83b478ee4aa7b89a7a9873a1843f54ba48.tar.bz2 | |
Ie Report : Donus and Select pilot tables
Diffstat (limited to 'app/assets/javascripts')
| -rw-r--r-- | app/assets/javascripts/compliance_checks/report.js.coffee | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/assets/javascripts/compliance_checks/report.js.coffee b/app/assets/javascripts/compliance_checks/report.js.coffee index 2e0dfea67..2bff8742e 100644 --- a/app/assets/javascripts/compliance_checks/report.js.coffee +++ b/app/assets/javascripts/compliance_checks/report.js.coffee @@ -17,7 +17,10 @@ $(".compliance_checks.report, .imports.compliance_check, #sidebar.compliance_che return insertSeverityDonut = (type) -> - Morris.Donut({ + triggerFilter = (type,state) -> + $("select.filter-status option[value='status-#{state}']").prop('selected', true) + $('.table').trigger 'footable_filter', filter: "#{state}_#{type}" + momo = Morris.Donut({ element: type, data: [ { label: $(".table").data('title-nok'), value: $("tr.nok_#{type}").size() }, @@ -27,10 +30,15 @@ $(".compliance_checks.report, .imports.compliance_check, #sidebar.compliance_che colors: [ "#e22b1b", "#898e7f", "#8fc861" ] }).on('click', update = (i, row) -> switch i - when 0 then $('.table').trigger 'footable_filter', filter: "nok_#{type}" - when 1 then $('.table').trigger 'footable_filter', filter: "uncheck_#{type}" - when 2 then $('.table').trigger 'footable_filter', filter: "ok_#{type}" + when 0 then triggerFilter(type,'nok') + when 1 then triggerFilter(type,'uncheck') + when 2 then triggerFilter(type,'ok') ) + $('select.filter-status').change (e)-> + switch $('select.filter-status option:selected').val() + when 'status-nok' then momo.select(0) + when 'status-uncheck' then momo.select(1) + when 'status-ok' then momo.select(2) $("##{type}").hide() insertSeverityDonut('error') |
