fix bugs(choose float field will get no value) in version 1.
This commit is contained in:
parent
9428475124
commit
f93a11d638
|
@ -265,22 +265,26 @@ class Admin::CancerpredictsController < OrbitAdminController
|
||||||
end
|
end
|
||||||
if @field_property["is_num"] == 1
|
if @field_property["is_num"] == 1
|
||||||
if @field_property["is_float"] == 1
|
if @field_property["is_float"] == 1
|
||||||
@table_str_left += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/></div>'
|
@table_str_left += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><input class="num_only_value" type="hidden" /></div>'
|
||||||
else
|
else
|
||||||
@table_str_left += '<div class="num_group"><form class="for_num">'
|
if @field_property["range"] == []
|
||||||
@table_str_left += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/>'
|
@table_str_left += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/></div>'
|
||||||
@table_str_left += '<input class="num_only_value" type="hidden" value="0"/>'
|
else
|
||||||
@please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
|
@table_str_left += '<div class="num_group"><form class="for_num">'
|
||||||
@table_str_left += '<select class="select_num"><option value="">'+@please_choice+'</option>'
|
@table_str_left += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/>'
|
||||||
if @field_property["choice_fields"] != []
|
@table_str_left += '<input class="num_only_value" type="hidden" value="0"/>'
|
||||||
@field_property["choice_fields"].each do |choice|
|
@please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
|
||||||
@table_str_left += ('<option value="0">' + choice.to_s.titleize + '</option>')
|
@table_str_left += '<select class="select_num"><option value="">'+@please_choice+'</option>'
|
||||||
|
if @field_property["choice_fields"] != []
|
||||||
|
@field_property["choice_fields"].each do |choice|
|
||||||
|
@table_str_left += ('<option value="0">' + choice.to_s.titleize + '</option>')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
for @num in @field_property["range"][0] .. @field_property["range"][1]
|
||||||
|
@table_str_left += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
|
||||||
|
end
|
||||||
|
@table_str_left += '</select></form></div>'
|
||||||
end
|
end
|
||||||
for @num in @field_property["range"][0] .. @field_property["range"][1]
|
|
||||||
@table_str_left += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
|
|
||||||
end
|
|
||||||
@table_str_left += '</select></form></div>'
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@table_str_left += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
|
@table_str_left += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
|
||||||
|
@ -320,22 +324,26 @@ class Admin::CancerpredictsController < OrbitAdminController
|
||||||
end
|
end
|
||||||
if @field_property["is_num"] == 1
|
if @field_property["is_num"] == 1
|
||||||
if @field_property["is_float"] == 1
|
if @field_property["is_float"] == 1
|
||||||
@table_str_right += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><button class="btn-sub"></button><button class="btn-add"></button></div>'
|
@table_str_right += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><input class="num_only_value" type="hidden" /></div>'
|
||||||
else
|
else
|
||||||
@table_str_right += '<div class="num_group"><form class="for_num">'
|
if @field_property["range"] == []
|
||||||
@table_str_right += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/>'
|
@table_str_left += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/></div>'
|
||||||
@table_str_right += '<input class="num_only_value" type="hidden" value="0"/>'
|
else
|
||||||
@please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
|
@table_str_right += '<div class="num_group"><form class="for_num">'
|
||||||
@table_str_right += '<select class="select_num"><option value="">'+@please_choice+'</option>'
|
@table_str_right += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/>'
|
||||||
if @field_property["choice_fields"] != []
|
@table_str_right += '<input class="num_only_value" type="hidden" value="0"/>'
|
||||||
@field_property["choice_fields"].each do |choice|
|
@please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
|
||||||
@table_str_right += ('<option value="0">' + choice.to_s.titleize + '</option>')
|
@table_str_right += '<select class="select_num"><option value="">'+@please_choice+'</option>'
|
||||||
|
if @field_property["choice_fields"] != []
|
||||||
|
@field_property["choice_fields"].each do |choice|
|
||||||
|
@table_str_right += ('<option value="0">' + choice.to_s.titleize + '</option>')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
for @num in @field_property["range"][0] .. @field_property["range"][1]
|
||||||
|
@table_str_right += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
|
||||||
|
end
|
||||||
|
@table_str_right += '</select></form></div>'
|
||||||
end
|
end
|
||||||
for @num in @field_property["range"][0] .. @field_property["range"][1]
|
|
||||||
@table_str_right += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
|
|
||||||
end
|
|
||||||
@table_str_right += '</select></form></div>'
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@table_str_right += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
|
@table_str_right += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
|
||||||
|
@ -407,22 +415,26 @@ class Admin::CancerpredictsController < OrbitAdminController
|
||||||
end
|
end
|
||||||
if @field_property["is_num"] == 1
|
if @field_property["is_num"] == 1
|
||||||
if @field_property["is_float"] == 1
|
if @field_property["is_float"] == 1
|
||||||
@table_result_choice_fileds += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><button class="btn-sub"></button><button class="btn-add"></button>'
|
@table_result_choice_fileds += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/><input class="num_only_value" type="hidden" /></button>'
|
||||||
else
|
else
|
||||||
@table_result_choice_fileds += '<div class="num_group"><form class="for_num">'
|
if @field_property["range"] == []
|
||||||
@table_result_choice_fileds += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/><button class="btn-sub"></button><button class="btn-add"></button></div>'
|
@table_str_left += '<div class="num_group"><input class="num_only float_num cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'"/></div>'
|
||||||
@table_str_left += '<input class="num_only_value" type="hidden" value="0"/>'
|
else
|
||||||
@please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
|
@table_result_choice_fileds += '<div class="num_group"><form class="for_num">'
|
||||||
@table_result_choice_fileds += '<select class="select_num"><option value="">'+@please_choice+'</option>'
|
@table_result_choice_fileds += '<input class="num_only cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;" data-range="'+@field_property["range"].to_s+'" onkeyup="value=value.replace(/[^\d]/g,\'\') "onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\d]/g,\'\'))"/><button class="btn-sub"></button><button class="btn-add"></button></div>'
|
||||||
if @field_property["choice_fields"] != []
|
@table_str_left += '<input class="num_only_value" type="hidden" value="0"/>'
|
||||||
@field_property["choice_fields"].each do |choice|
|
@please_choice = (current_locale.to_s == "zh_tw") ? "請選擇" : "Please choice"
|
||||||
@table_result_choice_fileds += ('<option value="0">' + choice.to_s.titleize + '</option>')
|
@table_result_choice_fileds += '<select class="select_num"><option value="">'+@please_choice+'</option>'
|
||||||
|
if @field_property["choice_fields"] != []
|
||||||
|
@field_property["choice_fields"].each do |choice|
|
||||||
|
@table_result_choice_fileds += ('<option value="0">' + choice.to_s.titleize + '</option>')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
for @num in @field_property["range"][0] .. @field_property["range"][1]
|
||||||
|
@table_result_choice_fileds += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
|
||||||
|
end
|
||||||
|
@table_result_choice_fileds += '</select></form></div>'
|
||||||
end
|
end
|
||||||
for @num in @field_property["range"][0] .. @field_property["range"][1]
|
|
||||||
@table_result_choice_fileds += ('<option value="' + @num.to_s + '">' + @num.to_s + '</option>')
|
|
||||||
end
|
|
||||||
@table_result_choice_fileds += '</select></form></div>'
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@table_result_choice_fileds += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
|
@table_result_choice_fileds += '<div class= "cancer-btn-group cancer_form_field" id="'+@field_property["variable"]+'" style="float:left;clear:right;">'
|
||||||
|
|
Loading…
Reference in New Issue