diff options
author | Alvin Li <liweitianux@gmail.com> | 2013-09-09 10:10:17 +0800 |
---|---|---|
committer | Alvin Li <liweitianux@gmail.com> | 2013-09-09 10:10:17 +0800 |
commit | 62efe8809e2cdfc84666dbd5e987a4ce473a047a (patch) | |
tree | f2b0021117894d19fc00e99c19b830826c157eee /97suifangqa/apps/indicator/static/javascripts/edit_history_data.js | |
parent | 52eebfa317cdc80739a19485880c2308c36eed91 (diff) | |
download | 97dev-62efe8809e2cdfc84666dbd5e987a4ce473a047a.tar.bz2 |
* finished modifying 'PM_TYPE' record for 'EditHistoryData' page
* synced '97suifang-front'
TODO:
* to merge changes of '97suifang-front'
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts/edit_history_data.js')
-rw-r--r-- | 97suifangqa/apps/indicator/static/javascripts/edit_history_data.js | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js b/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js index f4deafd..e0dff4a 100644 --- a/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js +++ b/97suifangqa/apps/indicator/static/javascripts/edit_history_data.js @@ -74,10 +74,21 @@ $(document).ready(function(){ }); // }}} + // initalize // set datepicker 'date_input' value var date_init = $.datepicker.parseDate('yy-mm-dd', $(".date_input").attr('value')); $(".date_input").datepicker("setDate", date_init); + // select radio button according to the original value + if ($(".editing_data .radio_input").length) { + $(".radio_input input:radio").prop("checked", false); + } + if (record.value === '-') { + $(".radio_input #minus_r").prop("checked", true); + } + else { + $(".radio_input #plus_r").prop("checked", true); + } // record data validate {{{ // date {{{ @@ -314,9 +325,41 @@ $(document).ready(function(){ else if (data_type == DATA_TYPES.FLOAT_RANGE_TYPE) { // TODO } - else if (data_type == DATA_TYPES.PM_TYPE) { + else if (data_type == DATA_TYPES.PM_TYPE) { // {{{ // TODO - } + var radioinput_help = '<p>请直接点击选择</p>'; + // tooltip + $(".radio_input").qtip({ + id: 'radioinput', + prerender: false, + content: { + text: radioinput_help + }, + position: { + my: 'bottom left', + at: 'top right' + }, + show: { + event: 'mouseenter' + }, + hide: { + event: 'mouseleave unfocus' + } + }); + // validate + $(".radio_input").on('validate', null, function() { + if ($(".radio_input input:radio:checked").length != 1) { + var qtip_content = '<p>请选择化验结果</p>'; + $(this).qtip('api').set('content.text', + qtip_content); + $(this).qtip('api').show(); + } + else { + // valid + record_data.value = $(".radio_input input:radio:checked").val(); + } + }); + } // }}} else { // unknown return false; |