jeecg 3.6.5 自定义查询条件无效处理

pull/6/merge
zhangdaiscott 2016-07-29 13:47:17 +08:00
parent fea32ae492
commit 26ea08629b
2 changed files with 21 additions and 15 deletions

View File

@ -460,7 +460,7 @@ public class DataGridTag extends TagSupport {
out = this.pageContext.getOut(); out = this.pageContext.getOut();
// String indexStyle =null; // String indexStyle =null;
//-----author:jg_longjb----start-----date:20150408--------for:读取cookie主题样式 ace界面下table的输出
// Cookie[] cookies = ((HttpServletRequest) super.pageContext // Cookie[] cookies = ((HttpServletRequest) super.pageContext
// .getRequest()).getCookies(); // .getRequest()).getCookies();
// for (Cookie cookie : cookies) { // for (Cookie cookie : cookies) {
@ -479,7 +479,7 @@ public class DataGridTag extends TagSupport {
out.print(end().toString()); out.print(end().toString());
out.flush(); out.flush();
// } // }
//-----author:jg_longjb----end-----date:20150408--------for:读取cookie主题样式 ace界面下table的输出
}else{ }else{
out.print(datatables().toString()); out.print(datatables().toString());
out.flush(); out.flush();
@ -754,7 +754,8 @@ public class DataGridTag extends TagSupport {
if (columnList.size() > 0) { if (columnList.size() > 0) {
sb.append("function " + name + "search(){"); sb.append("function " + name + "search(){");
//update by jg_renjie at 2016/1/11 for:TASK #823 增加form实现Form表单验证 //update by jg_renjie at 2016/1/11 for:TASK #823 增加form实现Form表单验证
sb.append("if($(\"#"+name+"Form\").Validform({tiptype:3}).check()){"); sb.append("try { if(! $(\"#"+name+"Form\").Validform({tiptype:3}).check()){return false;} } catch (e){}");
sb.append("if(true){");
//update by jg_renjie at 2016/1/11 for:TASK #823 增加form实现Form表单验证 //update by jg_renjie at 2016/1/11 for:TASK #823 增加form实现Form表单验证
sb.append("var queryParams=$(\'#" + name + "\').datagrid('options').queryParams;"); sb.append("var queryParams=$(\'#" + name + "\').datagrid('options').queryParams;");
sb.append("$(\'#" + name + "tb\').find('*').each(function(){queryParams[$(this).attr('name')]=$(this).val();});"); sb.append("$(\'#" + name + "tb\').find('*').each(function(){queryParams[$(this).attr('name')]=$(this).val();});");
@ -1307,14 +1308,14 @@ public class DataGridTag extends TagSupport {
sb.append(",formatter:function(value,rec,index){"); sb.append(",formatter:function(value,rec,index){");
sb.append(" return new Date().format('"+column.getFormatter()+"',value);}"); sb.append(" return new Date().format('"+column.getFormatter()+"',value);}");
} }
//author:xugj-----start-----date:20160512 ---- for: TASK #1080 【UI标签改造】t:dgCol 显示内容长度控制
else if(column.getShowLen()!=null){ //设置了显示多少长度的 else if(column.getShowLen()!=null){ //设置了显示多少长度的
sb.append(",formatter:function(value,rec,index){"); sb.append(",formatter:function(value,rec,index){");
sb.append(" if(value==undefined) {return ''} "); sb.append(" if(value==undefined) {return ''} ");
sb.append(" if(value.length<=");sb.append(column.getShowLen());sb.append(") {return value}"); sb.append(" if(value.length<=");sb.append(column.getShowLen());sb.append(") {return value}");
sb.append(" else{ return '<a title= '+value+'>'+ value.substring(0,");sb.append(column.getShowLen());sb.append(")+'...';}}"); sb.append(" else{ return '<a title= '+value+'>'+ value.substring(0,");sb.append(column.getShowLen());sb.append(")+'...';}}");
} }
//author:xugj-----end-----date:20160512 ---- for: TASK #1080 【UI标签改造】t:dgCol 显示内容长度控制
else if (columnValueList.size() > 0 && !column.getField().equals("opt")) {// 值替換 else if (columnValueList.size() > 0 && !column.getField().equals("opt")) {// 值替換
String testString = ""; String testString = "";
for (ColumnValue columnValue : columnValueList) { for (ColumnValue columnValue : columnValueList) {
@ -1574,7 +1575,6 @@ public class DataGridTag extends TagSupport {
this.langArg = langArg; this.langArg = langArg;
} }
//-----author:jg_longjb----start-----date:20150408--------for:新增ace 界面下的button class样式
public StringBuffer aceStyleTable() { public StringBuffer aceStyleTable() {
String grid = ""; String grid = "";
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
@ -1876,10 +1876,7 @@ public class DataGridTag extends TagSupport {
} }
return sb; return sb;
} }
//-----author:jg_longjb----end-----date:20150408--------for:新增封装查询器组件-
//-----author:jg_longjb----start-----date:20150427--------for:新增高级查询器queryBuilder
private void appendLine(StringBuffer sb,String str) { private void appendLine(StringBuffer sb,String str) {
String format = "\r\n"; //调试 格式化 String format = "\r\n"; //调试 格式化
sb.append(str).append(format); sb.append(str).append(format);
@ -2239,5 +2236,5 @@ appendLine(sb," }}\">关系</th>");
} }
return sb.toString(); return sb.toString();
} }
//----author:jg_longjb----start-----date:20150427--------for:新增封装查询器组件----
} }

View File

@ -1,6 +1,6 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%> <%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base> <t:base type="jquery,easyui,tools"></t:base>
<div class="easyui-layout" fit="true"> <div class="easyui-layout" fit="true">
<div region="center" style="padding:0px;border:0px"> <div region="center" style="padding:0px;border:0px">
<t:datagrid name="userList2" title="用户管理" actionUrl="userController.do?datagrid" idField="id" fit="true"> <t:datagrid name="userList2" title="用户管理" actionUrl="userController.do?datagrid" idField="id" fit="true">
@ -14,14 +14,16 @@
<t:dgDelOpt title="删除" url="userController.do?del&id={id}&userName={userName}" /> <t:dgDelOpt title="删除" url="userController.do?del&id={id}&userName={userName}" />
</t:datagrid> </t:datagrid>
<div id="userListtb" style="padding: 3px; height: 25px"> <!-- 列表自定义查询条件 -->
<div id="userList2tb" style="padding: 3px; height: 25px">
<div style="float: left;"> <div style="float: left;">
<a href="#" id="add" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="add('用户录入','userController.do?addorupdate','userList2')">用户录入</a> <a href="#" id="add" class="easyui-linkbutton" plain="true" icon="icon-add" onclick="add('用户录入','userController.do?addorupdate','userList2')">用户录入</a>
<a href="#" class="update" plain="true" icon="icon-edit" onclick="update('用户编辑','userController.do?addorupdate','userList2')">用户编辑</a></div> <a href="#" class="easyui-linkbutton" plain="true" icon="icon-edit" onclick="update('用户编辑','userController.do?addorupdate','userList2')">用户编辑</a></div>
<div align="right"> <div align="right">
用户名: <input class="easyui-validatebox" name="userName" style="width: 80px"> 用户名: <input class="easyui-validatebox" name="userName" style="width: 80px">
真实姓名: <input class="easyui-validatebox" name="realName" style="width: 80px"> 真实姓名: <input class="easyui-validatebox" name="realName" style="width: 80px">
<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="userListsearch();">查询</a> <a href="#" id="" class="easyui-linkbutton" iconCls="icon-search" onclick="userList2search();">查询</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="searchReset('userList2');">重置</a>
</div> </div>
</div> </div>
</div> </div>
@ -31,4 +33,11 @@
function szqm(id) { function szqm(id) {
createwindow('设置签名', 'userController.do?addsign&id=' + id); createwindow('设置签名', 'userController.do?addsign&id=' + id);
} }
//回车触发查询
$("body").keydown(function() {
//keyCode=13是回车键
if (event.keyCode == "13") {
userList2search();
}
});
</script> </script>