diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 06b154d36..9dd0bed8c 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -38,7 +38,7 @@ module MembersHelper scope = [] end principals = paginateHelper scope,10 - s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5') + s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals') links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options| link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true } diff --git a/app/views/members/autocomplete.js.erb b/app/views/members/autocomplete.js.erb index 01faf7da9..5f21ee38e 100644 --- a/app/views/members/autocomplete.js.erb +++ b/app/views/members/autocomplete.js.erb @@ -1,4 +1,9 @@ <% if @project%> + var checked = $("#principals input:checked").size(); + if(checked > 0) + { + alert('翻页或搜索后将丢失当前选择的用户数据!'); + } <% if @flag == "true"%> $('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>'); <% else%>