aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/static/javascripts/sheet_default.js
diff options
context:
space:
mode:
authorAlvin Li <liweitianux@gmail.com>2013-09-22 00:03:36 +0800
committerAlvin Li <liweitianux@gmail.com>2013-09-22 00:03:36 +0800
commit816730ff659e1338ab3e37a1d45ea337e337b3dd (patch)
tree1b979ada4afb79db1405bbc14067d6802d97eddf /97suifangqa/apps/indicator/static/javascripts/sheet_default.js
parentc9da4168874296cf4f5ba71b9a432ceae3c26130 (diff)
download97dev-816730ff659e1338ab3e37a1d45ea337e337b3dd.tar.bz2
auto redraw chart when:
* added new record * modified record data/date * deleted record EditHistoryData page: * added 'delete button' (#delete_btn) * added 'indicator.views.ajax_delete_record()' * updated css style for delete button * updated css style for record 'state' * added check for 'unit' when save 'IndicatorRecord'
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts/sheet_default.js')
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/sheet_default.js30
1 files changed, 26 insertions, 4 deletions
diff --git a/97suifangqa/apps/indicator/static/javascripts/sheet_default.js b/97suifangqa/apps/indicator/static/javascripts/sheet_default.js
index e5d9e9e..4d1683a 100644
--- a/97suifangqa/apps/indicator/static/javascripts/sheet_default.js
+++ b/97suifangqa/apps/indicator/static/javascripts/sheet_default.js
@@ -70,7 +70,7 @@ $(document).ready(function(){
var time = date.getTime();
$.ajax({ //数据库还是cookie,都可以,建议使用cookie,html中是否显示sub_title也由后端读取的cookie决定
type: 'get',
- url: indicator_url + 'ajax/close_sub_title',
+ url: indicator_url + 'ajax/close_sub_title/',
data: 'time='+time,
success: function(data){
if(data == 'success'){
@@ -419,7 +419,7 @@ $(document).ready(function(){
});
// }}}
- //点击提交icon
+ //点击提交icon {{{
$(".confirm_edit_icon").bind("click", function(){
var this_editing_data_div = $(this).closest(".editing_data");
var card = $(this).closest(".index_card");
@@ -488,8 +488,13 @@ $(document).ready(function(){
// refresh_icon
this_edit_data_div.find(".refresh_icon").show();
// edit_icon_container & chart
- this_editing_data_div.siblings(".edit_icon_container").hide();
- this_editing_data_div.siblings(".chart").show();
+ toggle_edit_hint(id, "hide");
+ // redraw chart
+ chart_getdata_draw("chart_"+id, id,
+ "options_chart_"+id,
+ chart_getdata_type, chart_dp_num,
+ null, null
+ );
}
}
});
@@ -497,6 +502,7 @@ $(document).ready(function(){
return false;
});
+ // }}}
//日期控件
$(".datepicker_container>.datepicker").datepicker({
@@ -526,6 +532,22 @@ $(document).ready(function(){
});
});
+// toggle 'edit_hint'
+function toggle_edit_hint(card_id, action) {
+ var card = $("#index_card_"+card_id);
+ var edit_hint = card.find(".edit_icon_container");
+ var chart = card.find(".chart");
+ if (action === 'show') {
+ chart.hide();
+ edit_hint.show();
+ }
+ else if (action === 'hide') {
+ edit_hint.hide();
+ chart.show();
+ }
+ return false;
+}
+
//
function delete_card(){
var card = $("#index_card_"+card_2_delete_id);