easyui 查看隐藏字段的值
2015-12-11 14:48
375 查看
通过列表查看按钮查看隐藏信息,需要用到索引值 index, event是为了点击查看按钮不会选中这行信息,有点绕口,显示详细信息是弹出一个dialog窗口,代码如下:
function look(index,event){
event.stopPropagation();
event.preventDefault();
var row = $('#preHandleSample').datagrid('getData').rows[index];
if(typeof(row.taksRemark) =='undefined'){
row.taksRemark="";
}
if(typeof(row.checkerRemark) == 'undefined'){
row.checkerRemark="";
}
$("#lookRemark").dialog({
title:'查看备注及其他说明',
href:base + "/sample-check-task/pre-handle/loadRemark.action?taksRemark="+row.taksRemark
+"&checkerRemark="+row.checkerRemark,
width: 700,
height: 500,
closed: false,
modal: true,
});
}
首先通过当前索引调用getDate返回当前选中行的数据,然后取得隐藏字段的信息,typeof 判断所取得的隐藏字段的类型,为什么要判断呢,因为如果我们所取得的字段没有信息,那么他的类型是 undefined,所以我这里加了typeof 用来判断,如果没有这种情况可以不加,看情况而定,我是用的struts2,后台跳一个方法返回到前台所弹出的dialog窗口。
action类:
public String loadRemark(){
Sample sample=new Sample();
sample.setRemark(taksRemark);
sample.setCheckerRemark(checkerRemark);
HttpServletRequest request = ServletActionContext.getRequest();
request.setAttribute("sample", sample);
return SUCCESS;
}
我是将这2 个字段属性封装在实体类里面放在request里,返回到前台的,也可以直接返回实体类。注意:字段属性要对应,一定要有set,get 方法。
jsp页面:
<form id="lookRemarker" method="post">
<table class="input" style="margin-left: auto; margin-right: auto; margin-top: 5px; width: 98%;">
<tbody>
<tr>
<th style="vertical-align:top">备注</th>
<td>
<textarea id="remark" style="width:98%;height:170px;resize: none;font-size:14px;" disabled="disabled">
<s:property value="#request.sample.remark"/>
</textarea></td>
</tr>
<tr>
<th style="vertical-align:top">其他说明</th>
<td>
<textarea id="checkerRemark" style="width:98%;height:170px;resize: none;font-size:14px;" disabled="disabled">
<s:property value="#request.sample.checkerRemark"/>
</textarea></td>
</tr>
</tbody>
</table>
</form> 阅读更多
function look(index,event){
event.stopPropagation();
event.preventDefault();
var row = $('#preHandleSample').datagrid('getData').rows[index];
if(typeof(row.taksRemark) =='undefined'){
row.taksRemark="";
}
if(typeof(row.checkerRemark) == 'undefined'){
row.checkerRemark="";
}
$("#lookRemark").dialog({
title:'查看备注及其他说明',
href:base + "/sample-check-task/pre-handle/loadRemark.action?taksRemark="+row.taksRemark
+"&checkerRemark="+row.checkerRemark,
width: 700,
height: 500,
closed: false,
modal: true,
});
}
首先通过当前索引调用getDate返回当前选中行的数据,然后取得隐藏字段的信息,typeof 判断所取得的隐藏字段的类型,为什么要判断呢,因为如果我们所取得的字段没有信息,那么他的类型是 undefined,所以我这里加了typeof 用来判断,如果没有这种情况可以不加,看情况而定,我是用的struts2,后台跳一个方法返回到前台所弹出的dialog窗口。
action类:
public String loadRemark(){
Sample sample=new Sample();
sample.setRemark(taksRemark);
sample.setCheckerRemark(checkerRemark);
HttpServletRequest request = ServletActionContext.getRequest();
request.setAttribute("sample", sample);
return SUCCESS;
}
我是将这2 个字段属性封装在实体类里面放在request里,返回到前台的,也可以直接返回实体类。注意:字段属性要对应,一定要有set,get 方法。
jsp页面:
<form id="lookRemarker" method="post">
<table class="input" style="margin-left: auto; margin-right: auto; margin-top: 5px; width: 98%;">
<tbody>
<tr>
<th style="vertical-align:top">备注</th>
<td>
<textarea id="remark" style="width:98%;height:170px;resize: none;font-size:14px;" disabled="disabled">
<s:property value="#request.sample.remark"/>
</textarea></td>
</tr>
<tr>
<th style="vertical-align:top">其他说明</th>
<td>
<textarea id="checkerRemark" style="width:98%;height:170px;resize: none;font-size:14px;" disabled="disabled">
<s:property value="#request.sample.checkerRemark"/>
</textarea></td>
</tr>
</tbody>
</table>
</form> 阅读更多
相关文章推荐
- easyui 查看隐藏字段的值
- 怎样查看隐藏设计数据库的文档字段信息
- 隐藏表中字段
- 与MSSQL对比学习MYSQL的心得(三)--查看字段的长度
- easyui datagrid 列隐藏和显示
- macbook air 查看隐藏文件
- Postgres查看数据库中的表及表中字段和类型
- 文档库/列表隐藏字段
- “查看更多”与“隐藏”
- 查看数据库中的字段所在的表中或某值所在的表和字段
- (VB报表)未能用指定的连接串 "连接字段" 连接到数据源,连接串中的用户名与密码已隐藏
- ADF12C 代码查看被修改ROW的某个字段的没被修改前的值
- java 部分隐藏字段
- 【框架-MFC】MFC 显示和隐藏 星号密码 以及如何预防被查看
- 查看Oracle_表名、字段名、注释、进程及杀进程等常用语句(转别人的)
- 应用程序状态管理①隐藏表单字段②cookie③session④URL重写
- Mac 查看隐藏文件
- Oracle中查看所有表和字段
- django admin字段 添加显示隐藏效果
- 实用SQL:查看表字段信息