js格式化时间为JSON格式 ajax提交 后台处理
var effectRow = new Object();
if ($('#grd_infos').datagrid('getChanges').length) {
var update = $('#grd_infos').datagrid('getChanges', "updated");
if (update.length) {
//var jsonArray = mini.decode(update);
//var jsonArray = JSON.stringify(update);
for (var i = 0; i < update.length; i++) {
for (var key in update[i]) {//如果是时间字段
if (key.toString() == "…" || key.toString() == "…"
|| key.toString() == "…" || key.toString() == "Time") {
update[i][key] = convertDateToJSONDate(update[i][key]);
}
}
}effectRow["updated"] = JSON.stringify(update);
}
}
$.post("/url….", effectRow, function (data) {
if (data) {
$.messager.alert('', data, 'info');
window.open("Machine_Repair", "_self");
}
}, "JSON").error(function () {
$.messager.alert("提示", "提交错误了!");
});
List<Repair_Entry> listUpdated =new List<Repair_Entry>();
if (Request["updated"] != null && Request["updated"].Trim() != "")
jsonUpdate = Request["updated"];if (jsonUpdate != "")
{listUpdated = JsonDeserialize<List<Repair_Entry>>(jsonUpdate);
}
private T JsonDeserialize<T>(string jsonString)
{
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T));
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
T obj = (T)ser.ReadObject(ms);
return obj;
}
js格式化时间为JSON格式 ajax提交 后台处理的更多相关文章
- 原生JS日历 + JS格式化时间格式
公司项目中用到,以前没做过,废了好几个小时 终于做好了 先来效果图(暂时没写样式 凑合着看吧) 点击左右按钮都能改变月份 下方表格中的数据也会跟着变化 贴上代码 : html部分: <div s ...
- js格式化时间的方法
方法一:用js格式化时间的方法. Date.prototype.format =function(format) { var o = { "M+" : this.getMonth( ...
- js 格式化时间日期函数小结3
function DateUtil(){}/***功能:格式化时间*示例:DateUtil.Format("yyyy/MM/dd","Thu Nov 9 20:30:37 ...
- JS格式化时间并比较
JS格式化时间,然后进行比较.工作遇到的情况,然后网上找到的,记下来,下次用! </head> <body> <button onclick="myFuncti ...
- js格式化时间 js格式化时间戳
一个js格式化时间和js格式化时间戳的例子. 代码:/** * 时间对象的格式化; */Date.prototype.format = function(format) { /* * eg:forma ...
- js格式化时间和时间操作
js格式化时间 function formatDateTime(inputTime) { var date = new Date(inputTime); var y = date.getFullYea ...
- ajax 提交 json格式数据到后台
例子:$.ajax({ type: 'POST', url: "/ROOT/modify.do", contentType: "application/json" ...
- js格式化时间(指定模板格式)
1 /** 格式化时间 2 * @param {string} date 需要格式化的时间 3 * @param {string} fmt 想要格式化的格式 4 */ 5 function forma ...
- js实现字符串转JSON格式
在浏览器前端实现字符串转JSON格式,有多种方法,总结如下: 方法1. js函数,eval() 语法: var obj = eval ("(" + txt + ")&qu ...
随机推荐
- wcf契约版本处理与异常处理(随记)
-----------版本控制策略:必须支持向后兼容:----就是当服务端发生改变,但客户端未更新会不会发生错误: 一旦契约发布,若要契约发生变化,如何不影响客户端使用: ----wsdl:契约: 服 ...
- Coded UI Test对Webpage进行自动化测试
如何使用Coded UI Test对Webpage进行自动化测试 在Visual Studio中,Coded UI Test已经不是什么新特性了,较早版本的Visual Studio中就已经有这个 ...
- 看AngularJS
最近一段时间一直在看AngularJS,趁着一点时间总结一下. 官网地址:http://angularjs.org/ 先推荐几个教程 1. AngularJS入门教程 比较基础,是官方Tutorial ...
- Weblogic Server 的下载,安装配置与部署
下载 下载页面: http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html 目前 ...
- MVC应用程序请求密码的功能(二)
MVC应用程序请求密码的功能(二) 在完成<MVC应用程序请求密码的功能(一)>http://www.cnblogs.com/insus/p/3471534.html之后,如果你照着做,所 ...
- nginx 安装启动
[root@localhost ~]# wget http://nginx.org/download/nginx-0.7.67.tar.gz --2010-09-24 14:48:12-- http: ...
- django 创建一个通用视图
创建一个通用视图 抽取出我们代码中共性的东西是一个很好的编程习惯. 比如,像以下的两个Python函数: def say_hello(person_name): print 'Hello, ...
- Git - error: RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly
在用Git管理代码版本时,用git push命令提交代码,提示: 有以下几个可能性: Git 版本过低.GitCafe 推荐使用的 Git 版本是 >= 1.7. $ git --version ...
- iOS 监听声音按键
有时在项目中需要监听用户是否按下了物理声音键,然后来做某些操作,如:你自定义了一个照相功能,希望用户按下声音按键时也能进行拍照,苹果自带的照相机就有这种功能. 监听物理声音键是否按下的方法有很多中,我 ...
- 一,IL访问静态属性和字段
一,IL访问静态属性和字段 IL介绍 通用中间语言(Common Intermediate Language,简称CIL,发音为"sill"或"kill")是一 ...