[jeeplus] 使用笔记 (gridSelect、datetimepicker etc.)
本贴最后更新于 1867 天前,其中的信息可能已经时过境迁
相关帖子
请输入回帖内容
...
-
- 其他回帖
-
PeterChu •作者
主附表的页面中的如果某个字段用了字典,那么页面上该怎么显示该字段呢。
自动生成的页面的 Js 代码这块直接是{{dict.name}}
,dict 没见到哪里定义、或者调用了字典,数据库中当然存的是字典的 value,而不是 name ;
我之前的解决办法都是,存储的时候,直接存字典的 name 到数据库表中,这里显示的时候,就用{row.name}
,怎么用其他方法呢
2019-6-13 15:50:51
找到解决办法:原因:js 中未对使用了字典的字段做处理。在 2.41 新版本中发现此处 js 中有处理方法。
function detailFormatter(index, row) { var htmltpl = $("#volunteerChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var html = Mustache.render(htmltpl, { idx:row.id }); $.get("${ctx}/volunteer/volunteerconfig/volunteer/detail?id="+row.id, function(volunteer){ var volunteerChild1RowIdx = 0, volunteerChild1Tpl = $("#volunteerChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var data1 = volunteer.volunteerConfigList; for (var i=0; i<data1.length; i++){ data1[i].dict = {}; data1[i].dict.name = jp.getDictLabel(${fns:toJson(fns:getDictList('school_batches'))}, data1[i].name, "-"); addRow('#volunteerChild-'+row.id+'-1-List', volunteerChild1RowIdx, volunteerChild1Tpl, data1[i]); volunteerChild1RowIdx = volunteerChild1RowIdx + 1; } }) return html; }
这样之后,下面
<script type="text/template" id="volunteerChild1Tpl"> <tr> <td> {{row.dict.name}} </td> <td> {{row.vindex}} </td> <td> {{row.isArt}} </td> <td> {{row.isAdvance}} </td> <td> {{row.reportedStart}} </td> <td> {{row.reportedEnd}} </td> <td> {{row.raiseStart}} </td> <td> {{row.raiseEnd}} </td> <td> {{row.enrollStart}} </td> <td> {{row.enrollEnd}} </td> </tr> </script>
中就可以直接使用
{{row.dict.name}}
,这样,页面中主附表的附表内该字段就会正常显示了。1 操作PeterChu 在 2019-06-13 15:55:15 更新了该回帖 -
PeterChu •作者
慎用
select *
当自己手写一些 sql 时,如果查找的对象/表中有封装了其他对象,那么,当 sql 中有
select *
时会导致封装对象为 Null 的现象。
因此,如果有会使用到封装的对象,那么 xml 中的 sql 还是加上映射关系吧。
eg:<!-- 根据年份、省份、高校、文理科、批次查找记录 findListByYPNWB --> <select id="findListByYPNWB" resultType="Eucode" > SELECT <include refid="EucodeColumns"/> FROM e_uecode a <include refid="EucodeJoins"/> WHERE a.year = #{year} AND a.province = #{province.id} AND a.universityid = #{university.id} AND a.wltype = #{wltype} AND a.schoolbatches = #{schoolBatches} AND (a.r3 != "2" OR ISNULL(a.r3)) AND (a.r3 != "3" OR ISNULL(a.r3)) </select>
-
PeterChu •作者
怎么让主附表中的附表也打开横向滚动条?
用 CSS 样式控制显示出来吗?尝试一下<style> .tab-content{ overflow-x: scroll; width: 3000px; } </style>
添加该样式后显示不正确。
暂且在 list.jsp 中添加:<style> .tabs-container .tab-content > .active, .tabs-container .pill-content > .active { display: block; overflow-x: auto; width: 3000px; } </style>
- 查看全部回帖