|
本帖最后由 wuhao3325 于 2018-10-10 10:39 编辑
界面布局如上:
将datagrid的显示调到了下面,原先在上面的!此布局原先参照常用示例上下表单布局二
现在问题是:
布局调了以后datagrid的行点击事件无响应了!
贴上代码:
$(function() {
$("#aaJysjbList").datagrid({
onClickRow : function(rowIndex, rowData) {
fillData(rowData);
console.log("1234566")
$("#editPanel1").panel({
title : "编辑数据"
});
}
});
//隐藏滚动条,固定高度,可根据表单字段数量调整
/* $("body").css({
"overflow" : "hidden",
"height" : "600px"
});
*/
$("#formobj").Validform({
tiptype : 1,
dragonfly : false,
tipSweep : false,
showAllError : false,
postonce : true,
ajaxPost : true
});
})
请问坛主,这是什么原因导致的????????????
这个jsp代码:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script src="webpage/com/jeecg/jianyanguanli/aaJysjbList.js"></script>
<script type="text/javascript">
/* //保护价(全局)
var bhj = 0.0;
//自定义按钮-录入 */
function doJyluru(id, index) {
jyluru(id);
}
//自定义按钮-提交
function doJytijiao(id, index) {
var selRows = $("#aaJysjbList").datagrid('getData').rows[index];
var selrowj = selRows.mcJsdj;
if (selrowj != "" && selrowj >= 0) {
var url = "aaJysjbController.do?tiJiao&id=" + id;
$.ajax({
url : url,
type : "get",
dataType : "json",
success : function(data) {
top.tip(data.msg);
if (data.success) {
//提交完成后必须清空录入窗口数据
//清空表单
clearData();
$("#aaJysjbList").datagrid('reload');
}
}
});
} else {
alert("不好意思,请录入数据再提交!!!!!")
}
}
//导入
function ImportXls() {
openuploadwin('Excel导入', 'aaJysjbController.do?upload', "aaJysjbList");
}
//导出
function ExportXls() {
JeecgExcelExport("aaJysjbController.do?exportXls", "aaJysjbList");
}
//模板下载
function ExportXlsByT() {
JeecgExcelExport("aaJysjbController.do?exportXlsByT", "aaJysjbList");
}
function fillData(rowData) {
if (rowData["jysj"] == null) {
rowData["jysj"] = getNowFormatDate();
}
//清空表单
$("#formobj").form('clear');
//填充数据
for ( var d in rowData) {
$("#" + d).val(rowData[d]);
}
var z1 = rowData["mcZzl"];
var shuifen = rowData["mcShuifen"];
var zazhi = rowData["mcZazhi"];
var huangmili = rowData["mcHmlhl"];
var guwai = rowData["mcGwcmhl"];
var huhun = rowData["mcHhl"];
var seze = rowData["mcQzsw"];
var shijian = rowData["jysj"];
if (z1 == "") {
document.getElementById("mcZzl").value = 100.00;
}
if (shuifen == "") {
document.getElementById("mcShuifen").value = 1;
}
if (zazhi == "") {
document.getElementById("mcZazhi").value = 1;
}
if (huangmili == "") {
document.getElementById("mcHmlhl").value = 1;
}
if (guwai == "") {
document.getElementById("mcGwcmhl").value = 1;
}
if (huhun == "") {
document.getElementById("mcHhl").value = 1;
}
if (seze == "") {
document.getElementById("mcQzsw").value = 1;
}
if (shijian == "") {
document.getElementById("jysj").value = "${datess}";
}
//处理特殊控件方式
/* var birthday = rowData["birthday"];
if (birthday != undefined) {
birthday = birthday.replace(" 00:00:00.0", "");
} else {
birthday = "";
}
$("#birthday").datebox("setValue", birthday); */
}
$(function() {
$("#aaJysjbList").datagrid({
onClickRow : function(rowIndex, rowData) {
fillData(rowData);
console.log("1234566")
$("#editPanel1").panel({
title : "编辑数据"
});
}
});
//隐藏滚动条,固定高度,可根据表单字段数量调整
/* $("body").css({
"overflow" : "hidden",
"height" : "600px"
});
*/
$("#formobj").Validform({
tiptype : 1,
dragonfly : false,
tipSweep : false,
showAllError : false,
postonce : true,
ajaxPost : true
});
})
function getNowFormatDate() {
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1
+ strDate + " " + date.getHours() + seperator2
+ date.getMinutes() + seperator2 + date.getSeconds();
return currentdate;
}
//保存数据
function saveData() {
//var demo=$(".formsub").Validform();
$("#formobj").Validform({
callback : function(data) {
top.tip(data.msg);
if (data.success) {
clearData();
$("#aaJysjbList").datagrid('reload');
}
}
}).ajaxPost(false, true);
}
function cancelEdit() {
var rowData = $("#aaJysjbList").datagrid("getSelected");
if (rowData != null) {
fillData(rowData);
$("#editPanel").panel({
title : "编辑数据"
});
} else {
clearData();
}
}
function clearData() {
var rowData = {};
fillData(rowData);
$("#editPanel1").panel({
title : "新增数据"
});
$("#aaJysjbList").datagrid('clearChecked');
}
function htmlDoJob(msg) {
document.all.value2.value = msg;
}
function checkField1() {
var t1 = document.getElementById("mcDao").value;
var t2 = document.getElementById("mcMi").value;
var t3 = document.getElementById("mcCml").value;
if (t1 != "" && t2 != "") {
document.getElementById("mcCml").value = ((parseInt(t2) / parseInt(t1)) * 100)
.toFixed(2);
} else {
document.getElementById("mcCml").value = "";
}
var url = "aaJcjgController.do?doSelect1&id=" + t0;
$
.ajax({
url : url,
type : "get",
dataType : "json",
success : function(data) {
if (data.success) {
var t4 = data.obj;
var t5 = document.getElementById("mcCml").value;
var t6 = document.getElementById("mcJsdj").value;
if (t4 != 0 && t5 != "") {
document.getElementById("mcJsdj").value = ((t4 * t5) / 100)
.toFixed(2);
} else {
top.tip("请先设置今日基础价格");
}
}
}
});
}
function checkField2() {
var t0 = document.getElementById("mcJcdj").value;
var url = "aaJcjgController.do?doSelect1&id=" + t0;
$
.ajax({
url : url,
type : "get",
dataType : "json",
success : function(data) {
if (data.success) {
var t4 = data.obj;
var t5 = document.getElementById("mcCml").value;
var t6 = document.getElementById("mcJsdj").value;
if (t4 != 0 && t5 != "") {
document.getElementById("mcJsdj").value = ((t4 * t5) / 100)
.toFixed(2);
} else {
top.tip("请先设置今日基础价格");
}
}
}
});
}
var num = 0;
function timeout() {
num = Math.floor(Math.random() * 300 + 1);
document.getElementById("value3").innerHTML = num;
}
setInterval("timeout()", 1000);
function daoclick() {
document.getElementById("mcDao").value = num;
checkField1();
}
function miclick() {
document.getElementById("mcMi").value = num;
checkField1();
}
</script>
<style type="text/css">
.value {
padding: 10px auto 10px 10px;
}
.main1 {
background-color: black;
width: 100%;
height: 100px;
margin: 0 auto;
}
.lianjiezhuangtai {
text-align: right; /*让div内部文字居中*/
background-color: #fff;
width: 100%;
height: 20px;
margin: 0 auto;
}
.shuxian1 {
padding: 23px 0;
float: right;
width: 15%;
color: green;
font-size: 90px;
text-align: right;
}
.shuxian2 {
padding: 40px 0;
float: left;
width: 83%;
color: green;
font-size: 90px;
text-align: right;
}
</style>
<div>
<div style="height: 380px; width: 100%; float: left;">
<div title="新增数据" style="height: 350px;" name="editPanel"
id="editPanel1" fit="true" class="easyui-panel">
<div style="height: 300px; width: 100%; float: left;">
<div class="datagrid-toolbar" style="float: left; width: 100%;">
<a href="#" class="easyui-linkbutton l-btn l-btn-plain"
plain="true" icon="icon-add"> 清空表单 </a> <a
href="#" class="easyui-linkbutton l-btn l-btn-plain" plain="true"
icon="icon-undo"> 重置表单 </a> <a href="#"
class="easyui-linkbutton l-btn l-btn-plain" plain="true"
icon="icon-save" id="btn_sub"> <!-- -->
提交数据
</a>
</div>
<div>
<div id="content1"
style="background-color: #EEEEEE; height: 325px; width: 50%; float: left;">
<div
style="background-color: #EEEEEE; height: 121px; width: 100%; float: left;">
<div style="width: 70%; float: left;">
<div class="main1">
<div class="shuxian1">g</div>
<div class="shuxian2" id="value3">0.00</div>
</div>
<div class="lianjiezhuangtai">
<h1>连接状态</h1>
</div>
</div>
<div
style="background-color: #EEEEEE; height: 120px; width: 30%; float: left;">
<div class="datagrid-toolbar"
style="width: 100%; padding: 6px 30%;">
<button href="#" class="easyui-linkbutton l-btn l-btn-plain"
plain="true">稻克重</button>
</div>
<div class="datagrid-toolbar"
style="width: 100%; padding: 6px 30%;">
<button href="#" class="easyui-linkbutton l-btn l-btn-plain"
plain="true">米克重</button>
</div>
<div class="datagrid-toolbar"
style="width: 100%; padding: 5px 30%;">
<button href="#" class="easyui-linkbutton l-btn l-btn-plain"
plain="true">连接设置</button>
</div>
</div>
</div>
<div style="background-color: #EEEEEE; width: 100%; float: left;">请刷卡确认
</div>
</div>
<div id="menu"
style="background-color: #FFD700; width: 50%; float: left;">
<t:formvalid formid="formobj" dialog="true" usePlugin="password"
layout="table" tiptype="1" action="aaJysjbController.do?doUpdate">
<input id="id" name="id" type="hidden" value="${aaJysjbPage.id }" />
<table style="width: 100%; height: 100%;" cellpadding="0"
cellspacing="1" class="formtable">
<tr>
<td align="right"><label class="Validform_label">
检验单号: </label></td>
<td class="value"><input id="code" name="code" type="text"
readonly="readonly" style="width: 150px"
class="Validform_checktip" placeholder="請輸入"
validType="aa_jysjb,code,id" datatype="*" ignore="checked" />
<span class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">检验单号</label></td>
<td align="right"><label class="Validform_label">
稻克重: </label></td>
<td class="value"><input id="mcDao" name="mcDao"
type="text" style="width: 150px" class="Validform_checktip"
datatype="n" ignore="checked" /> <span
class="Validform_checktip">g</span> <label
class="Validform_label" style="display: none;">稻克重</label></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
米克重: </label></td>
<td class="value"><input id="mcMi" name="mcMi" type="text"
style="width: 150px" class="Validform_checktip" datatype="n"
ignore="ignore" /> <span
class="Validform_checktip">g</span> <label
class="Validform_label" style="display: none;">米克重</label></td>
<td align="right"><label class="Validform_label">
折重率: </label></td>
<td class="value"><input id="mcZzl" name="mcZzl"
type="text" style="width: 150px" class="Validform_checktip"
datatype="/^(-?\d+)(\.\d+)?$/" ignore="ignore" value="100.00" />
<span class="Validform_checktip">%</span> <label
class="Validform_label" style="display: none;">折重率</label></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
基础单价: </label></td>
<td class="value">
<!-- <input id="mcJcdj" name="mcJcdj"
type="text" style="width: 150px" class="searchbox-inputtext"
ignore="ignore"
/> --> <t:dictSelect
field="mcJcdj" dictTable="AA_jcjg" dictField="id" type="list"
id="mcJcdj" dictCondition="where t_date = ${currentTimes}"
dictText="mc_jgsz" title="基础单价"></t:dictSelect> <span
class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">基础单价</label>
</td>
<td align="right"><label class="Validform_label">
水分: </label></td>
<td class="value"><t:dictSelect id="mcShuifen"
field="mcShuifen" type="list" typeGroupCode="zhuangtai1"
hasLabel="false" title="水分"></t:dictSelect> <span
class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">水分</label></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
杂质: </label></td>
<td class="value"><t:dictSelect id="mcZazhi"
field="mcZazhi" type="list" typeGroupCode="zhuangtai1"
hasLabel="false" title="杂质"></t:dictSelect> <span
class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">杂质</label></td>
<td align="right"><label class="Validform_label">
黄粒米含量: </label></td>
<td class="value"><t:dictSelect id="mcHmlhl"
field="mcHmlhl" type="list" typeGroupCode="zhuangtai1"
hasLabel="false" title="黄粒米含量"></t:dictSelect> <span
class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">黄粒米含量</label></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
谷外糙米含量: </label></td>
<td class="value"><t:dictSelect id="mcGwcmhl"
field="mcGwcmhl" type="list" typeGroupCode="zhuangtai1"
hasLabel="false" title="谷外糙米含量"></t:dictSelect> <span
class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">谷外糙米含量</label></td>
<td align="right"><label class="Validform_label">
互混率: </label></td>
<td class="value"><t:dictSelect id="mcHhl" field="mcHhl"
type="list" typeGroupCode="zhuangtai1" hasLabel="false"
title="互混率"></t:dictSelect> <span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">互混率</label></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
气择色味: </label></td>
<td class="value"><t:dictSelect id="mcQzsw" field="mcQzsw"
type="list" typeGroupCode="zhuangtai2"
defaultVal="${aaJysjbPage.mcQzsw}" hasLabel="false"
title="气择色味"></t:dictSelect> <span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">气择色味</label></td>
<td align="right"><label class="Validform_label">
出米率: </label></td>
<td class="value"><input id="mcCml" name="mcCml"
type="text" style="width: 150px" class="Validform_checktip"
readonly="readonly" datatype="/^(-?\d+)(\.\d+)?$/"
ignore="ignore" /> <span class="Validform_checktip">%</span>
<label class="Validform_label" style="display: none;">出米率</label></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
结算单价: </label></td>
<td class="value"><input id="mcJsdj" name="mcJsdj"
type="text" style="width: 150px" class="Validform_checktip"
datatype="/^(-?\d+)(\.\d+)?$/" ignore="ignore"
readonly="readonly" /> <span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">结算单价</label>
</td>
<td align="right"><label class="Validform_label">
</label></td>
<td class="value"></td>
</tr>
<tr>
<td align="right"><label class="Validform_label">
检验时间: </label></td>
<td class="value"><input id="jysj" name="jysj" type="text"
readonly="readonly" style="width: 150px" class="Wdate"
ignore="ignore" /> <span class="Validform_checktip"></span> <label
class="Validform_label" style="display: none;">检验时间</label></td>
<td align="right"><label class="Validform_label">
</label></td>
<td class="value"></td>
</tr>
</table>
</t:formvalid>
</div>
</div>
</div>
</div>
<!-- <div data-options="region:'east',
title:'mytitle',
collapsed:true,
split:true,
border:false,
onExpand : function(){
li_east = 1;
},
onCollapse : function() {
li_east = 0;
}"
style="width: 400px; overflow: hidden;" id="eastPanel">
<div class="easyui-panel" style="padding:0px;border:0px" fit="true" border="false" id="userListpanel"></div>
</div> -->
</div>
</div>
<div style="height: 450px; width: 100%; float: left;">
<div class="easyui-layout" fit="true">
<div region="center" style="padding: 0px; border: 0px">
<t:datagrid name="aaJysjbList" checkbox="false" pagination="true"
fitColumns="true" title="检验数据" pageSize="5"
actionUrl="aaJysjbController.do?datagrid&onfinish=0" idField="id"
fit="true" queryMode="group">
<t:dgCol title="id" field="id" hidden="true" queryMode="group"
width="120"></t:dgCol>
<t:dgCol title="检验单号" field="code" query="true" queryMode="single"
width="160"></t:dgCol>
<t:dgCol title="稻克重" field="mcDao" queryMode="single" width="60"></t:dgCol>
<t:dgCol title="米克重" field="mcMi" queryMode="single" width="60"></t:dgCol>
<t:dgCol title="折重率" field="mcZzl" queryMode="single" width="60"></t:dgCol>
<t:dgCol title="基础单价" field="mcJcdj" queryMode="single"
dictionary="AA_jcjg,id,mc_jgsz" width="60"></t:dgCol>
<t:dgCol title="水分" field="mcShuifen" queryMode="single"
dictionary="zhuangtai1" width="60"></t:dgCol>
<t:dgCol title="杂质" field="mcZazhi" queryMode="single"
dictionary="zhuangtai1" width="120"></t:dgCol>
<t:dgCol title="黄粒米含量" field="mcHmlhl" queryMode="single"
dictionary="zhuangtai1" width="120"></t:dgCol>
<t:dgCol title="谷外糙米含量" field="mcGwcmhl" queryMode="single"
dictionary="zhuangtai1" width="120"></t:dgCol>
<t:dgCol title="互混率" field="mcHhl" queryMode="single"
dictionary="zhuangtai1" width="120"></t:dgCol>
<t:dgCol title="气择色味" field="mcQzsw" queryMode="single"
dictionary="zhuangtai2" width="120"></t:dgCol>
<t:dgCol title="出米率" field="mcCml" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="结算单价" field="mcJsdj" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="检验员" field="jyy" queryMode="single"
dictionary="AA_Person,id,name" width="80"></t:dgCol>
<t:dgCol title="检验时间" field="jysj" formatter="yyyy-MM-dd hh:mm:ss"
query="true" queryMode="group" width="120"></t:dgCol>
<t:dgCol title="检验状态" field="onfinish" hidden="true"
queryMode="single" width="120"></t:dgCol>
<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
<%-- <t:dgDelOpt title="删除" url="aaJysjbController.do?doDel&id={id}"
urlclass="ace_button" urlfont="fa-trash-o" /> --%>
<t:dgFunOpt funname="doJytijiao(id)" title="提交"
urlclass="ace_button" urlfont="fa-wrench" />
<%-- <t:dgToolBar title="录入" icon="icon-add"
url="aaJysjbController.do?goAdd" funname="add"></t:dgToolBar>
<t:dgToolBar title="编辑" icon="icon-edit"
url="aaJysjbController.do?goUpdate" funname="update"></t:dgToolBar>
<t:dgToolBar title="批量删除" icon="icon-remove"
url="aaJysjbController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
<t:dgToolBar title="查看" icon="icon-search"
url="aaJysjbController.do?goUpdate" funname="detail"></t:dgToolBar>
<t:dgToolBar title="导入" icon="icon-put" funname="ImportXls"></t:dgToolBar>
<t:dgToolBar title="导出" icon="icon-putout" funname="ExportXls"></t:dgToolBar>
<t:dgToolBar title="模板下载" icon="icon-putout" funname="ExportXlsByT"></t:dgToolBar> --%>
<t:dgToolBar title="打印" icon="icon-print"
url="aaJysjbController.do?print" funname="detail" width="610"
height="330"></t:dgToolBar>
</t:datagrid>
</div>
</div>
</div>
|
|