#1360 翻页或搜索之前若已经选择了用户数据则给出提示信息

This commit is contained in:
gonglexin 2014-10-21 16:51:30 +08:00
parent f576fb994b
commit 0ba1477f1b
2 changed files with 10 additions and 1 deletions

View File

@ -82,7 +82,11 @@
<p style="padding-top: 5px"><%= l(:label_role_plural) %>: <p style="padding-top: 5px"><%= l(:label_role_plural) %>:
<% roles.each do |role| %> <% roles.each do |role| %>
<% if role.id == 10 %> <!-- 默认学生角色 -->
<label><%= radio_button_tag 'membership[role_ids][]', role.id, true %> <%= h role %></label>
<% else %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label> <label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% end %>
<% end %></p> <% end %></p>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p> <p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>

View File

@ -1,6 +1,11 @@
<% if @project%> <% if @project%>
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>'); $('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>');
<% elsif @course%> <% elsif @course%>
var checked = $("#principals input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_course_members(@course)) %>'); $('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_course_members(@course)) %>');
<%end%> <%end%>
var collection=$("#principals_for_new_member").children("#principals").children("label"); var collection=$("#principals_for_new_member").children("#principals").children("label");