jsp 다중 선택 및 모호한 검색 하단 상자

4263 단어 JSP
(document).ready(function (){(".ordrStatus1").hide();//원본 선택 팝업 상자("#closeStatus").click(function (){$(".ordrStatus1").fadeOut(300);             });(“#closd”).click(function(){ (“.ordrStatus1”).fadeOut(300);          });(“.beSelect”).removeAttr(“border-color”); (“#searchText”).keyup(function(){var searchText = (this).val();var beSelectT=";(".beSelect").each(){beSelectT=(this).parent().text();if(beSelectT.indexOf(searchText)=-1){//(this).prop("checked",false);(this).parent().hide();}else{ $(this).parent().show(); } });
       });
 });


 function showStatus1(abc){
            var ordrStatus1s = $(".ordrStatus1").is(":hidden");
            if(ordrStatus1s){
                 $("#searchText").val("");
                 var value = $("#userSelect").val();
                 $("#selectList").children().remove();
                 $.ajax({
                       type : "POST",
                       data:{userId2: value},
                     url: "/query.action",
                       success: function(json){
                            var divStru ="";
                            divStru = "
"; var checkedIds = $("#orderStatusT").val(); var flag = true; $.each(json,function(key,obj){ if(checkedIds.indexOf(obj.vipId)!=-1){

div=”
”+obj.vipName+”
“;
}else{
flag=false;
div=”
”+obj.vipName+”
“;
}
divStru += div;
});
divStru += “”;
(“#selectList”).append(divStru);                if(flag){ (“#selecAll1”).prop(“checked”,true);
}
}
});
                var offset = $(abc).offset();
                var w = $(abc).width();

               $(".ordrStatus1").show();
               $("#selectList").css({width: w+15});
               $("#selectList").css("padding-left","20px");
               $(".ordrStatus1").css("height","auto");
               $("#selectList").css("height","auto");
               $(".ordrStatus1").css("max-height","275px");
               $("#selectList").css("max-height","200px");
            }else{
                 $(".ordrStatus1").hide();
            }


 }

 function selectAll1(){
       var isCheck = $("[id='selecAll1']").prop("checked");
            $(".beSelect").each(function(){
                 if(!$(this).is(":hidden")){
                       $(this).prop("checked",isCheck);
                 }

       });
 }
 // 
 function sureSelect(){
       var checkIds = "";
       var checkNames = "";
       $(".beSelect:checked").each(function(){
            checkIds += $(this).attr('value') +",";
            checkNames += $(this).parent().text()+",";
       });
       $("#vipId").val(checkIds);
       checkNames = checkNames.substring(0, checkNames.length-1);
       checkIds = checkIds.substring(0, checkIds.length-1);
       $("#orderStatus").val(checkNames);
       $("#orderStatusT").val(checkIds);
       $(".ordrStatus1").fadeOut(200);
 };

================================================css==========css=====begin===============css==============
 .ordrStatus1{
 vertical-align:middle;
 border:1px solid #ccc;
  background-color: #fff;
  position:absolute;display:none;
  cursor: pointer;
  border-radius:1px solid #ccc;
  color:#0060ca;
  z-index:9999;
  }

  .beSelect{
  height:18px;
  border-color:#FFFFFF;
  }
  #selecAll1 {
  height:18px;
  border-color:#FFFFFF;
  }

================================================css==========css=====end===============css==============
================================================html==========html=====start===============html==============
고객

좋은 웹페이지 즐겨찾기