function initEntryDetail(){ $('#Business_entryDetail_show_datagrid').datagrid({ loadMsg: '数据加载中请稍后……', url:"/manage/platform/dispatch/bookWarehouse/btpBookingEntry//listJson.html", queryParams: { search_EQ_dispatchId: $("#dispatchId").val(), search_EQ_isDelete:0 }, border:false, fitColumns:false, singleSelect:false, idField:'id', pagination:true, pageSize:20, pageList:[ 10, 20, 30, 40, 50], sortName:'id', sortOrder:'desc', checkOnSelect:true, selectOnCheck:true, columns: [[ {field: 'id',title: "id",hidden: true}, { field: 'actionId', title: "操作", formatter: function (value, row, index) { return "<a href='javascript:void(0)' onclick='makeTrueTime(" + value + "," + JSON.stringify(row) + "," + index + ")'>确认收货</a> " } }, {field: 'isClick',title: "isClick",hidden: true}, {field: 'billLadingNo',title: "提单号/运单号", width:150}, {field: 'oneDistance',title: "一程日期",width:150}, {field: 'twoDistance', width:250,title:"二程日期"}, {field: 'prematchShipDate',title: "预计到货日期",width:150}, {field: 'shipCompany',title: "海船公司",width:150}, {field: 'containerDate', width:250,title:"放箱日期"}, { field: 'attachment', width: 250, title: "放箱单上传", formatter: function(value, row, index) { return '<a href="javascript:void(0)" class="attachment-btn">上传附件</a>'; } }, {field: 'billLadingDate', width:250,title:"提单日期"}, {field: 'actOneDistance', width:250,title:"实际一程日期"}, {field: 'actTwoDistance', width:250,title:"实际二程日期"}, {field: 'arriveDate', width:250,title:"运抵日期"}, {field: 'receiptConfimDate', width:250,title:"收货确认日期"}, ]] }) }makeTrueTime设置当前时间到receiptConfimDate列上展示

时间: 2023-07-19 22:40:58 浏览: 44
你可以在 `makeTrueTime` 方法中,调用 datagrid 的 `updateRow` 方法,更新 `receiptConfimDate` 列的值。具体步骤如下: 1. 获取 datagrid 对象和当前行的索引值。 ```javascript var datagrid = $('#Business_entryDetail_show_datagrid'); var index = datagrid.datagrid('getRowIndex', row); ``` 2. 获取当前时间,并将其格式化为你需要的日期格式。 ```javascript var now = new Date(); var dateStr = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); ``` 3. 使用 `updateRow` 方法更新 `receiptConfimDate` 列的值。 ```javascript datagrid.datagrid('updateRow', { index: index, row: { receiptConfimDate: dateStr } }); ``` 完整的 `makeTrueTime` 方法代码如下: ```javascript function makeTrueTime(value, row, index) { var datagrid = $('#Business_entryDetail_show_datagrid'); var index = datagrid.datagrid('getRowIndex', row); var now = new Date(); var dateStr = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); datagrid.datagrid('updateRow', { index: index, row: { receiptConfimDate: dateStr } }); } ``` 当你点击确认收货链接时,就会触发该方法,自动将当前时间更新到 `receiptConfimDate` 列上展示。

相关推荐

{ field: 'actionId', title: "操作", formatter: function (value, row, index) { return "确认收货 " } },{field: 'receiptConfimDate', width:250,title:"收货确认日期"}, function makeTrueTime(value, row, index) { debugger; row.receiptConfimDate = formatDate(new Date()); $('#Business_entryDetail_show_datagrid').datagrid('refreshRow',index) }列上没有刷新成功的原因

最新推荐

recommend-type

easyui datagrid 大数据加载效率慢,优化解决方法(推荐)

下面小编就为大家带来一篇easyui datagrid 大数据加载效率慢,优化解决方法(推荐)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
recommend-type

c#datagrid操作,解决datagridView加载慢.docx

发现了datagridview直接绑定DataSource加载数据比较慢的问题,从网上找了很多资料,没有有效的解决方案,
recommend-type

博图WinCC V16用ADODB、DataGrid控件显示SQL Server数据.docx

博图WinCC V16用ADODB、DataGrid控件VB脚本显示SQL Server数据
recommend-type

C#设置WinForm中DataGrid列的方法(列宽/列标题等)

主要介绍了C#设置WinForm中DataGrid列的方法,包括列宽、列标题等部分,并分析了其中相关的操作技巧,具有一定参考借鉴价值,需要的朋友可以参考下
recommend-type

JQuery_EasyUI_DataGrid_中文文档

JQuery EasyUI DataGrid_中文文档,各种属性的详细描述
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

MATLAB柱状图在信号处理中的应用:可视化信号特征和频谱分析

![matlab画柱状图](https://img-blog.csdnimg.cn/3f32348f1c9c4481a6f5931993732f97.png) # 1. MATLAB柱状图概述** MATLAB柱状图是一种图形化工具,用于可视化数据中不同类别或组的分布情况。它通过绘制垂直条形来表示每个类别或组中的数据值。柱状图在信号处理中广泛用于可视化信号特征和进行频谱分析。 柱状图的优点在于其简单易懂,能够直观地展示数据分布。在信号处理中,柱状图可以帮助工程师识别信号中的模式、趋势和异常情况,从而为信号分析和处理提供有价值的见解。 # 2. 柱状图在信号处理中的应用 柱状图在信号处理
recommend-type

从键盘输入一段英文字符串,其中包含多个字母‘h',请编写程序利用正则表达式,将英文字符串中的’h'全部改为‘H’

好的,我可以帮您解决这个问题。 您可以使用 Python 编写一个程序来实现这个功能。具体步骤如下: 1. 首先导入 re 模块,这个模块是 Python 中用于处理正则表达式的模块。 2. 然后定义一个包含英文字符串的变量,例如: text = "This is a string containing multiple h's." 3. 接下来,使用 re.sub() 方法来进行替换操作。re.sub() 方法的第一个参数是正则表达式,第二个参数是替换的字符或字符串,第三个参数是被替换的字符串。在这个例子里,我们需要将所有的小写字母 h 替换成大写字母 H,所以正则表达式可以写成
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。