<t:dgFunOpt funname 函数取不到值
jsp代码
或者这样写也不行
<t:dgFunOpt funname="queryInstByDepart(orgCode)" title="查看下e属机构" urlclass="ace_button"urlfont="fa-user"></t:dgFunOpt>
已收录 修改方案:
/src/main/java/org/jeecgframework/core/common/model/json/TreeGrid.java
assembleFieldsJson方法修改为:
private String assembleFieldsJson() {
String fieldsJson = ", 'fieldMap':" + JSON.toJSON(fieldMap);
if (fieldMap != null && fieldMap.size() > 0) {
Map<String, Object> resultMap = new HashMap<String, Object>();
for (Map.Entry<String, Object> entry : fieldMap.entrySet()) {
resultMap.put("fieldMap." + entry.getKey(), entry.getValue());
}
fieldsJson += ", " + JSON.toJSON(resultMap).toString().replace("{", "").replace("}", "");
}
return fieldsJson;
}
页面使用:
<t:dgFunOpt funname="queryInstByDepart(fieldMap.orgCode)" title="查看下e属机构" urlclass="ace_button"urlfont="fa-user"></t:dgFunOpt> fly1206 发表于 2018-7-16 18:16 static/image/common/back.gif
修改方案:
/src/main/java/org/jeecgframework/core/common/model/json/TreeGrid.java
assembleFieldsJson ...
谢谢哈!
也可以这样修改
/jeecg/src/main/java/org/jeecgframework/tag/core/easyui/TagUtil.java
修改getFunParams 这个方法
/**
* 获取自定义函数的参数
*
* @param functionname
* @return
*/
public static String getFunParams(String functionname) {
int index = functionname.indexOf("(");
String param = "";
if (index != -1) {
String testparam = functionname.substring(
functionname.indexOf("(") + 1, functionname.length() - 1);
if (StringUtil.isNotEmpty(testparam)) {
String[] params = testparam.split(",");
for (String string : params) {
param += (string.indexOf("{") != -1) ? ("'\"+"
+ string.substring(1, string.length() - 1) + "+\"',")
: ("'\"+rec['" + string + "']+\"',");
}
}
}
param += "'\"+index+\"'";// 传出行索引号参数
return param;
页面使用:
<t:dgFunOpt funname="queryInstByDepart(fieldMap.orgCode)" title="查看下e属机构" urlclass="ace_button"urlfont="fa-user"></t:dgFunOpt>
页:
[1]