首页 新闻 搜索 专区 学院

jsp添加百分比功能

0
悬赏园豆:200 [待解决问题]

<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.freeplatform.system.bean.FormSaveBean"%>
<%@page import="com.freeplatform.framework.tools.StringUtil"%>
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="gstl" uri="/free" %>
<%@ include file="/framework/commons/taglib.jsp"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>列表</title>
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/gs.ui.core.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/toolbar/gs.ui.toolbar.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/gs.ui.icon.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/grid/gs.ui.grid.css" />
<link type="text/css" rel="stylesheet" href="<%=path%>/theme/blue/css/window/gs.ui.window.css"/>
<link type="text/css" rel="stylesheet" href="<%=path%>/theme/blue/css/form/gs.ui.form.css"/>
</head>
<body>
<div id="toolbar1" class="toolbar"></div>
<form id="form" action="" method="post">
<div id="queryTable1" class="queryTable">
<table>
<tbody>
<tr>
<th>&nbsp;数据源:</th>
<td>
<select id="_q_table" name="queryTable" style="width: 140px;" >
<option value="">请选择</option>
<c:forEach items="${ requestScope.dltjnameList }" var="dltjname">
<option value="${ dltjname.dictItemCode }"
<c:if test="${energy.queryTable eq dltjname.dictItemCode }">selected="selected"</c:if>>${
dltjname.dictItemName }</option>
</c:forEach>
</select>
</td>
<th>&nbsp;方案:</th>
<td>
<input size="10" id="famc" name="famc" readonly="readonly" value="${tbean.famc }"/>
</td>


<input type="hidden" size="10" id="table" name="table" value="${tbean.table }" />

<input type="hidden" size="10" id="id" name="id" value="${tbean.id }" />

<input type="hidden" size="10" id="dIs" name="dIs" value="${tbean.dIs }" />


<th>&nbsp;&nbsp;日期:</th>
<td>
<input type="text" id="startDateStr" name="startDateStr" value="${tbean.startDateStr }" style="width: 150px;" size="19" />
&nbsp;至&nbsp;
<input type="text" id="endDateStr" name="endDateStr" value="${tbean.endDateStr }" style="width: 150px;" size="19" />
</td>
<th>&nbsp;&nbsp;排序:</th>
<td>
<select id="_q_isSortDatatime">
<option value="false">设备</option>
</select>&nbsp;&nbsp;
</td>

<td><input type="button" id="querybtn" value="查询" style="padding: 2px;"/></td>
<td><input type="button" id="clearbtn" value="清空" style="padding: 2px;" /></td>
</tr>
</tbody>
</table>
</div>

<gstl:grid id="grid1">
<gstl:grid-head>
<tr>
<th class="num">&nbsp;</th>
<c:forTokens items="${fbean.mark}" delims="," var="tech" varStatus="index">
<th style="width: 100px;" align="center"><c:out
value="${index.count == 2 ? '开始时间' :
(index.count == 3 ? '结束时间' : tech)}" />
</th>
</c:forTokens>
</tr>
</gstl:grid-head>
<gstl:grid-body>
<%
FormSaveBean bean = request.getAttribute("fbean") != null ?
(FormSaveBean)request.getAttribute("fbean"): new FormSaveBean();
if(StringUtil.killNull(bean.getdIs())){
//String[] fieldArry =bean.getdIs().split(",");
%>
<c:forEach items="${list}" var="list" varStatus="vs" >
<tr>
<td class="num">${vs.count }</td>
<c:forEach items="${forList }" var="forList" varStatus="forVs">
<td>
<span style="width: 90px; text-align: right;">
<c:out value="${list[forList] }" />
</span>
</td>

</c:forEach>
</tr>
</c:forEach>
<%
}
%>
</gstl:grid-body>
</gstl:grid>

<input type="hidden" id="_sbids" name="sbids" value="" />
<input type="hidden" id="_ContextPath" value="${pageContext.request.contextPath}" />
<input type="hidden" id="_seqList" name="seqList" />
<input type="hidden" id="_info" value="${energy.info }" />
<input type="hidden" name="querySbids" id="_q_sbids" value="${energy.querySbids }" />
<input type="hidden" id="_hid" name="hid" />


<%-- <input type="hidden" id="_h_table" value="${energy.queryTable }"/> --%>
<%-- <input type="hidden" id="_h_sbids" value="${energy.querySbids }"/> --%>
<%-- <input type="hidden" id="_h_dataDateBeginStr" value="${energy.queryDatatimeBeginStr }"/> --%>
<%-- <input type="hidden" id="_h_dataDateEndStr" value="${energy.queryDatatimeEndStr }"/> --%>
<%-- <input type="hidden" id="_h_isSortDatatime" value="${energy.queryIsSortDatatime }"/> --%>
</form>
<script type="text/javascript" src="<%=path%>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.core.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.grid.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.button.js"></script>
<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path%>/framework/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.window.js"></script>
<script type="text/javascript">
var tb1;
var grid1;
var form1;

var sp1;


var queryTable = null;
var querySbids = null;
var queryDatatimeBeginStr = null;
var queryDatatimeEndStr = null;
var queryIsSortDatatime = null;

var hght = 0;//初始化滚动条总长--数据可见高度
var currenttop = 0;//初始化滚动条的当前位置--滚动高度
var dataH = 0;//数据总长度
var page = 1;
var flag = false;
$(document).ready(function(){
form1=$('#form');

tb1=$('#toolbar1').toolBar();

grid1=$('#grid1').grid({
width:window.parent.document.body.clientWidth-220,
height:window.parent.document.body.clientHeight-70,
isdragable:true
});

$('#queryTable1').show();
$("#startDateStr").click(function(){
WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"});
});
$("#endDateStr").click(function(){
WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"});
});

$('#querybtn').bind('click',function(){
if("" == $("#_q_table").val()){
alert("请选择数据类型");
return false;
}
form1.attr("action",$("#_ContextPath").val()+"/report/energy/querydian2.do").submit();
});

$('#clearbtn').bind('click',function(){
$("#_q_table").val("");
$("#startDateStr").val("");
$("#endDateStr").val("");
});

tb1.addButton('导出','icon-application_view_detail',true,function(){
form1.attr("action",$("#_ContextPath").val()+"/report/energy/toExcelDianJia.do").submit();
});
tb1.addButton('打印','icon-printer',true,function(){
var url = "report/energy/toPrintDianJia.do";
var data = new Object();
var search = '';

search = search + "?queryTable="+$("#_q_table").val()+"&querySbids="+$("#_q_sbids").val()+
"&queryDatatimeBeginStr="+$('#startDateStr').val()+
"&queryDatatimeEndStr="+ $("#endDateStr").val()+
"&queryIsSortDatatime="+ $("#_q_isSortDatatime").val();
data.parameter = search;
var play = 'height=500,width=750,top=' + (screen.height - 500) / 2 + ',left=' + (screen.width - 750) / 2
+ ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no,status=no, z-look=yes';
if (popWindow(CONTEXT_ROOT + url, data, play)) {
return null;
} else {
return null;
}
});

queryTable = $("#_h_table").val();
querySbids = $("#_h_sbids").val();
queryDatatimeBeginStr = $('#startDateStr').val();
queryDatatimeEndStr = $("#endDateStr").val();
queryIsSortDatatime = $("#_h_isSortDatatime").val();

//加载更多数据
function show(){
page = page + 1;
if (flag == false) {
//获取数据
$.get($("#_ContextPath").val() + "/report/energy/queryDianJia2.do?queryTable="+queryTable+"&querySbids="+querySbids+"&queryDatatimeBeginStr="+queryDatatimeBeginStr+"&queryDatatimeEndStr="+queryDatatimeEndStr+"&queryIsSortDatatime="+queryIsSortDatatime +"&marked="+page, function(data){//利用jquery的get方法得到table.jsp内容
if(null == data && "".equals(data)) {
flag = true;
};
$(".grid-body-div tbody").append(data);//用append方法追加内容到div2元素。
hght = 0;//恢复滚动条总长,因为$("#div2").scroll事件一触发,又会得到新值,不恢复的话可能会造成判断错误而再次加载……
currenttop = 0;
dataH = 0;
});
}
};

$(".grid-body-div").scroll( function() {//定义滚动条位置改变时触发的事件。
hght=$(".grid-body-div").height();//得到滚动条总长,赋给hght变量--可见高度
currenttop=$(".grid-body-div").scrollTop();//得到滚动条当前值,赋给currenttop变量--滚动高度
dataH =$(".grid-body-div").get(0).scrollHeight;//内容高度

if(currenttop == (dataH - hght)) {
show();
}
});

$("#_q_table").change(function() {
var cod = $("#_q_table").val();
sp1=$(document.body).windowPanel({src:'<%=path%>/window/toDianliang.do?_q_table='+cod,
width:600,
height:350,
title:'电表',dragable:true,bg_useable:false,clossConfirm:false,
callback:function(data){
var str = data.split(";");
var tab = "";
var fal = "";
var falid = "";
var dIs = "";
for(var i = 0 ; i < str.length ; i ++ ){
fal = str[0];
tab = str[1];
falid = str[2];
dIs = str[3];
}

$('#famc').val(fal);
$('#table').val(tab);
$('#id').val(falid);
$('#dIs').val(dIs);
sp1.windowCloss();
}
});
sp1.windowOpen();
});


var temp_time='';
var temp_array=new Array();
$('#grid1').find('.grid-body').find('tr').each(function(){
if(temp_time==''){
temp_time=$(this).find('td').eq(2).text();
}
if(temp_time!=$(this).find('td').eq(2).text()){
var _trHtml = $('<tr style="background:#0f0"></tr>');
$(this).before(_trHtml);
for(var ii=0;ii<temp_array.length;ii++){
if(ii>3)
_trHtml.append('<td style="width: 90px; text-align: right;">'+temp_array[ii].toFixed(2)+'</td>');
else if(ii=3)
_trHtml.append('<td colspan="4">合计</td>');

}
temp_time=$(this).find('td').eq(2).text();
temp_array=new Array();
}
$(this).find('td').each(function(i){
if(isNaN(parseFloat(temp_array[i]))){
temp_array[i]=0;
}
temp_array[i]=parseFloat(temp_array[i])+parseFloat($(this).text());
});

});
var _trHtml = $('<tr style="background:#0f0"></tr>');
$('#grid1').find('.grid-body').find('tr:last').after(_trHtml);
for(var ii=0;ii<temp_array.length;ii++){
if(ii>3)
_trHtml.append('<td style="width: 90px; text-align: right;">'+temp_array[ii].toFixed(2)+'</td>');
else if(ii=3)
_trHtml.append('<td colspan="4">合计</td>');
}

});
function setvalue(){
var cod = $("#_q_table").val();
return cod;
}
<!-- // setInterval("cando();",2000);//每隔2秒钟调用一次cando函数来判断当前滚动条位置。
// function cando(){
// if(currenttop > parseInt(hght/3)*2){//判断滚动条当前位置是否超过总长的1/2,parseInt为取整函数
// show();//如果是,调用show函数加载内容。
// }
// }; -->

</script>
</body>
</html>
</script>

 

实现 百分比 求助

FJob的主页 FJob | 初学一级 | 园豆:2
提问于:2013-08-17 11:26
< >
分享
所有回答(5)
0

建议给代码加上着色,点击编辑器中的“插入代码”按钮

建议更详细描述问题,将问题表达清楚,问题就解决了一半

dudu | 园豆:36376 (高人七级) | 2013-08-17 14:14
0

亲,不要全部贴源码啊,最起码要表达一下你的思路想法啊,然后遇到的问题点在哪里,这样子全部贴出来而且又这么长,很头疼的。

直接复制代码贴出来的话也可以在编辑框的上面找到“插入代码”的哦。那样看着清晰点

W宁宁 | 园豆:522 (小虾三级) | 2013-08-17 14:27
0

亲,这样的形式大家木有耐心看下去啊!能把代码以另外的形式展示吗?另外咱把问题描述清楚,出处大家才好帮你是不?在编辑器中用这两个选择代码模式

妍珊 | 园豆:1169 (小虾三级) | 2013-08-17 14:58
0

我的妈呀,这是要发呀

huazhiliange | 园豆:203 (菜鸟二级) | 2013-08-17 14:59

我信里你的邪。。。

支持(0) 反对(0) ..00.. | 园豆:49 (初学一级) | 2013-08-17 17:37
0
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.freeplatform.system.bean.FormSaveBean"%>
<%@page import="com.freeplatform.framework.tools.StringUtil"%>
<%@ page language="java" contentType="text/html; charset=GB2312"
pageEncoding="GB2312"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="gstl" uri="/free" %>
<%@ include file="/framework/commons/taglib.jsp"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>列表</title>
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/gs.ui.core.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/toolbar/gs.ui.toolbar.css" /> 
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/gs.ui.icon.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/theme/blue/css/grid/gs.ui.grid.css" />
<link type="text/css" rel="stylesheet" href="<%=path%>/theme/blue/css/window/gs.ui.window.css"/>
<link type="text/css" rel="stylesheet" href="<%=path%>/theme/blue/css/form/gs.ui.form.css"/>
</head>
<body>
<div id="toolbar1" class="toolbar"></div>
<form id="form" action="" method="post">
<div id="queryTable1" class="queryTable">
<table>
<tbody>
<tr>
<th>&nbsp;数据源:</th>
<td>
<select id="_q_table" name="queryTable" style="width: 140px;" >
<option value="">请选择</option>
<c:forEach items="${ requestScope.dltjnameList }" var="dltjname">
<option value="${ dltjname.dictItemCode }"
<c:if test="${energy.queryTable eq dltjname.dictItemCode }">selected="selected"</c:if>>${
dltjname.dictItemName }</option>
</c:forEach>
</select>
</td>
<th>&nbsp;方案:</th>
<td>
<input size="10" id="famc" name="famc" readonly="readonly" value="${tbean.famc }"/>
</td>


<input type="hidden" size="10" id="table" name="table" value="${tbean.table }" />

<input type="hidden" size="10" id="id" name="id" value="${tbean.id }" />

<input type="hidden" size="10" id="dIs" name="dIs" value="${tbean.dIs }" />


<th>&nbsp;&nbsp;日期:</th>
<td>
<input type="text" id="startDateStr" name="startDateStr" value="${tbean.startDateStr }" style="width: 150px;" size="19" />
&nbsp;&nbsp;
<input type="text" id="endDateStr" name="endDateStr" value="${tbean.endDateStr }" style="width: 150px;" size="19" />
</td>
<th>&nbsp;&nbsp;排序:</th>
<td>
<select id="_q_isSortDatatime">
<option value="false">设备</option>
</select>&nbsp;&nbsp; 
</td>

<td><input type="button" id="querybtn" value="查询" style="padding: 2px;"/></td>
<td><input type="button" id="clearbtn" value="清空" style="padding: 2px;" /></td>
</tr>
</tbody>
</table>
</div>
<gstl:grid id="grid1">
<gstl:grid-head>
<tr>
<th class="num">&nbsp;</th>
<c:forTokens items="${fbean.mark}" delims="," var="tech" varStatus="index">
<th style="width: 100px;" align="center"><c:out
value="${index.count == 2 ? '开始时间' : 
(index.count == 3 ? '结束时间' : tech)}" />
</th>
</c:forTokens>
</tr>
</gstl:grid-head>
<gstl:grid-body>
<%
FormSaveBean bean = request.getAttribute("fbean") != null ? 
(FormSaveBean)request.getAttribute("fbean"): new FormSaveBean();
if(StringUtil.killNull(bean.getdIs())){
//String[] fieldArry =bean.getdIs().split(",");
%>
<c:forEach items="${list}" var="list" varStatus="vs" >
<tr>
<td class="num">${vs.count }</td>
<c:forEach items="${forList }" var="forList" varStatus="forVs">
<td>
<span style="width: 90px; text-align: right;">
<c:out value="${list[forList] }" />
</span>
</td>

</c:forEach>
</tr>
</c:forEach>
<%
}
%>
</gstl:grid-body>
</gstl:grid>

<input type="hidden" id="_sbids" name="sbids" value="" /> 
<input type="hidden" id="_ContextPath" value="${pageContext.request.contextPath}" /> 
<input type="hidden" id="_seqList" name="seqList" /> 
<input type="hidden" id="_info" value="${energy.info }" /> 
<input type="hidden" name="querySbids" id="_q_sbids" value="${energy.querySbids }" />
<input type="hidden" id="_hid" name="hid" />


<%-- <input type="hidden" id="_h_table" value="${energy.queryTable }"/> --%>
<%-- <input type="hidden" id="_h_sbids" value="${energy.querySbids }"/> --%>
<%-- <input type="hidden" id="_h_dataDateBeginStr" value="${energy.queryDatatimeBeginStr }"/> --%>
<%-- <input type="hidden" id="_h_dataDateEndStr" value="${energy.queryDatatimeEndStr }"/> --%>
<%-- <input type="hidden" id="_h_isSortDatatime" value="${energy.queryIsSortDatatime }"/> --%>
</form>
<script type="text/javascript" src="<%=path%>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.core.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.grid.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.button.js"></script>
<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path%>/framework/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=path%>/js/gs.ui.window.js"></script>
<script type="text/javascript">
var tb1;
var grid1;
var form1;

var sp1;


var queryTable = null;
var querySbids = null;
var queryDatatimeBeginStr = null;
var queryDatatimeEndStr = null;
var queryIsSortDatatime = null;

var hght = 0;//初始化滚动条总长--数据可见高度
var currenttop = 0;//初始化滚动条的当前位置--滚动高度
var dataH = 0;//数据总长度
var page = 1;
var flag = false;
$(document).ready(function(){
form1=$('#form');

tb1=$('#toolbar1').toolBar();
grid1=$('#grid1').grid({
width:window.parent.document.body.clientWidth-220,
height:window.parent.document.body.clientHeight-70,
isdragable:true
});
$('#queryTable1').show();
$("#startDateStr").click(function(){
WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"});
});
$("#endDateStr").click(function(){
WdatePicker({dateFmt:"yyyy-MM-dd HH:mm:ss"});
});

$('#querybtn').bind('click',function(){
if("" == $("#_q_table").val()){
alert("请选择数据类型");
return false;
}
form1.attr("action",$("#_ContextPath").val()+"/report/energy/querydian2.do").submit();
});

$('#clearbtn').bind('click',function(){
$("#_q_table").val("");
$("#startDateStr").val("");
$("#endDateStr").val("");
});

tb1.addButton('导出','icon-application_view_detail',true,function(){
form1.attr("action",$("#_ContextPath").val()+"/report/energy/toExcelDianJia.do").submit();
});
tb1.addButton('打印','icon-printer',true,function(){
var url = "report/energy/toPrintDianJia.do";
var data = new Object();
var search = '';

search = search + "?queryTable="+$("#_q_table").val()+"&querySbids="+$("#_q_sbids").val()+
"&queryDatatimeBeginStr="+$('#startDateStr').val()+
"&queryDatatimeEndStr="+ $("#endDateStr").val()+
"&queryIsSortDatatime="+ $("#_q_isSortDatatime").val();
data.parameter = search;
var play = 'height=500,width=750,top=' + (screen.height - 500) / 2 + ',left=' + (screen.width - 750) / 2
+ ',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no,status=no, z-look=yes';
if (popWindow(CONTEXT_ROOT + url, data, play)) {
return null;
} else {
return null;
}
});

queryTable = $("#_h_table").val();
querySbids = $("#_h_sbids").val();
queryDatatimeBeginStr = $('#startDateStr').val();
queryDatatimeEndStr = $("#endDateStr").val();
queryIsSortDatatime = $("#_h_isSortDatatime").val();

//加载更多数据
function show(){
page = page + 1;
if (flag == false) {
//获取数据
$.get($("#_ContextPath").val() + "/report/energy/queryDianJia2.do?queryTable="+queryTable+"&querySbids="+querySbids+"&queryDatatimeBeginStr="+queryDatatimeBeginStr+"&queryDatatimeEndStr="+queryDatatimeEndStr+"&queryIsSortDatatime="+queryIsSortDatatime +"&marked="+page, function(data){//利用jquery的get方法得到table.jsp内容
if(null == data && "".equals(data)) {
flag = true;
};
$(".grid-body-div tbody").append(data);//用append方法追加内容到div2元素。
hght = 0;//恢复滚动条总长,因为$("#div2").scroll事件一触发,又会得到新值,不恢复的话可能会造成判断错误而再次加载……
currenttop = 0;
dataH = 0;
});
}
};

$(".grid-body-div").scroll( function() {//定义滚动条位置改变时触发的事件。
hght=$(".grid-body-div").height();//得到滚动条总长,赋给hght变量--可见高度
currenttop=$(".grid-body-div").scrollTop();//得到滚动条当前值,赋给currenttop变量--滚动高度
dataH =$(".grid-body-div").get(0).scrollHeight;//内容高度

if(currenttop == (dataH - hght)) {
show();
}
});

$("#_q_table").change(function() {
var cod = $("#_q_table").val();
sp1=$(document.body).windowPanel({src:'<%=path%>/window/toDianliang.do?_q_table='+cod,
width:600,
height:350,
title:'电表',dragable:true,bg_useable:false,clossConfirm:false,
callback:function(data){
var str = data.split(";");
var tab = "";
var fal = "";
var falid = "";
var dIs = "";
for(var i = 0 ; i < str.length ; i ++ ){
fal = str[0];
tab = str[1];
falid = str[2];
dIs = str[3];
}

$('#famc').val(fal); 
$('#table').val(tab);
$('#id').val(falid);
$('#dIs').val(dIs);
sp1.windowCloss();
} 
});
sp1.windowOpen();
});


var temp_time='';
var temp_array=new Array();
$('#grid1').find('.grid-body').find('tr').each(function(){
if(temp_time==''){
temp_time=$(this).find('td').eq(2).text();
}
if(temp_time!=$(this).find('td').eq(2).text()){
var _trHtml = $('<tr style="background:#0f0"></tr>');
$(this).before(_trHtml);
for(var ii=0;ii<temp_array.length;ii++){
if(ii>3)
_trHtml.append('<td style="width: 90px; text-align: right;">'+temp_array[ii].toFixed(2)+'</td>');
else if(ii=3)
_trHtml.append('<td colspan="4">合计</td>');

}
temp_time=$(this).find('td').eq(2).text();
temp_array=new Array();
}
$(this).find('td').each(function(i){
if(isNaN(parseFloat(temp_array[i]))){
temp_array[i]=0;
}
temp_array[i]=parseFloat(temp_array[i])+parseFloat($(this).text());
});

});
var _trHtml = $('<tr style="background:#0f0"></tr>');
$('#grid1').find('.grid-body').find('tr:last').after(_trHtml);
for(var ii=0;ii<temp_array.length;ii++){
if(ii>3)
_trHtml.append('<td style="width: 90px; text-align: right;">'+temp_array[ii].toFixed(2)+'</td>');
else if(ii=3)
_trHtml.append('<td colspan="4">合计</td>');
}

});
function setvalue(){
var cod = $("#_q_table").val();
return cod;
}
<!-- // setInterval("cando();",2000);//每隔2秒钟调用一次cando函数来判断当前滚动条位置。
// function cando(){
// if(currenttop > parseInt(hght/3)*2){//判断滚动条当前位置是否超过总长的1/2,parseInt为取整函数
// show();//如果是,调用show函数加载内容。
// }
// }; -->

</script>
</body>
</html>
</script>
| 园豆:406 (菜鸟二级) | 2013-08-17 15:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册