function morenomore(){ $("body").prepend(""); var listall = []; var listall2 = []; var morenum = 0;//第几行更多,0是第一行 $("#gridlist").setgridparam({gridcomplete:function(){ //rownum自适应宽度 var page = $("#gridlist").jqgrid('getgridparam','page'); var rows = $('#gridlist').getgridparam("rownum"); var maxnum = (rows*page).tostring(); var len = (maxnum.length)*10; $('.jqgfirstrow').find('td').eq(0).css('width',len+'px'); $('#gridlist_rn').css('width',len+'px'); // var rowids = $("#gridlist").getdataids(); for (var i=0; i3){ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); if(math.max($(opes[0]).html().length,$(opes[1]).html().length)>2){ if($(opes[0]).html().length>$(opes[1]).html().length){ list.push(opelist[0]); $("#moreoperate"+rowid).append($(opes[1])); $(opes[1]).addclass("setstyle"); setstyle(); }else{ list.push(opelist[1]); $("#moreoperate"+rowid).append($(opes[0])); $(opes[0]).addclass("setstyle"); setstyle(); } $("#moreoperate"+rowid).append("
"); for(var j=2;j更多..."); $(opes[0]).addclass("setstyle"); setstyle(); $(opes[1]).addclass("setstyle"); setstyle(); for(var j=2;j2&&$(opes[1]).html().length>2&&$(opes[2]).html().length>2){ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[0])); $("#moreoperate"+rowid).append("
"); $(opes[0]).addclass("setstyle"); setstyle(); for(var j=1;j2){ if($(opes[1]).html().length>2){ if($(opes[2]).html().length<2){ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[2])); $(opes[2]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append("
"); list.push(opelist[0]); list.push(opelist[1]); listall.push(list); morenum++; var moreoperatewidth = 0; for(var k=0;k<$("#moreoperate"+rowid).children().length;k++){ moreoperatewidth += $($("#moreoperate"+rowid).children()[k]).width(); } if(moreoperatewidth!=0){ $("#moreoperate"+rowid).width(moreoperatewidth); } } }else{ if($(opes[2]).html().length>2){ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[1])); $(opes[1]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append("
"); list.push(opelist[0]); list.push(opelist[2]); listall.push(list); morenum++; var moreoperatewidth = 0; for(var k=0;k<$("#moreoperate"+rowid).children().length;k++){ moreoperatewidth += $($("#moreoperate"+rowid).children()[k]).width(); } if(moreoperatewidth!=0){ $("#moreoperate"+rowid).width(moreoperatewidth); } }else{ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[1])); $("#moreoperate"+rowid).append($(opes[2])); $(opes[1]).addclass("setstyle"); setstyle(); $(opes[2]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append("
"); list.push(opelist[0]); listall.push(list); morenum++; var moreoperatewidth = 0; for(var k=0;k<$("#moreoperate"+rowid).children().length;k++){ moreoperatewidth += $($("#moreoperate"+rowid).children()[k]).width(); } if(moreoperatewidth!=0){ $("#moreoperate"+rowid).width(moreoperatewidth); } } } }else{ if($(opes[1]).html().length>2){ if($(opes[2]).html().length>2){ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[0])); $(opes[0]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append("
"); list.push(opelist[1]); list.push(opelist[2]); listall.push(list); morenum++; var moreoperatewidth = 0; for(var k=0;k<$("#moreoperate"+rowid).children().length;k++){ moreoperatewidth += $($("#moreoperate"+rowid).children()[k]).width(); } if(moreoperatewidth!=0){ $("#moreoperate"+rowid).width(moreoperatewidth); } }else{ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[0])); $(opes[0]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append($(opes[2])); $(opes[2]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append("
"); list.push(opelist[1]); listall.push(list); morenum++; var moreoperatewidth = 0; for(var k=0;k<$("#moreoperate"+rowid).children().length;k++){ moreoperatewidth += $($("#moreoperate"+rowid).children()[k]).width(); } if(moreoperatewidth!=0){ $("#moreoperate"+rowid).width(moreoperatewidth); } } }else{ if($(opes[2]).html().length>2){ for(var j=0;j"); opelist.push($("#"+rowid+"wrap"+j).html()); } opes.remove(); tdopes.append("
"); $("#moreoperate"+rowid).append($(opes[0])); $(opes[0]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append($(opes[1])); $(opes[1]).addclass("setstyle"); setstyle(); $("#moreoperate"+rowid).append("
"); list.push(opelist[2]); listall.push(list); morenum++; var moreoperatewidth = 0; for(var k=0;k<$("#moreoperate"+rowid).children().length;k++){ moreoperatewidth += $($("#moreoperate"+rowid).children()[k]).width(); } if(moreoperatewidth!=0){ $("#moreoperate"+rowid).width(moreoperatewidth); } } } } } } } listall2 = listall; listall = []; morenum = 0; }}); setstyle = function(){ $(".setstyle").css("display","block"); $(".setstyle").height(24); $(".setstyle").width(($(".setstyle").html().length)*12+16); $(".setstyle").css("margin","0"); $(".setstyle").css("padding","0"); $(".setstyle").css("float","left"); $(".setstyle").css("line-height","24px"); } over = function(id,rownum){//鼠标移入 $("#moreop").children().remove(); var coord=$("#"+id+"d").offset(); $("#more").css("top",coord.top-1); $("#more").css("left",coord.left-$("#more").width()); $("#more").show(); for(var i=0;i(coord.left+$("#more").width())||mousey(coord.top+$("#more").height()))&&(mousex<(coord.left+$("#more").width())|| mousex>(coord.left+$("#more").width()+50)||mousey<(coord.top+1)||mousey>(coord.top+24+1))){ $("#more").hide(); } }); }