ExtJS前端日期数据传递到后台:数据格式转化
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了ExtJS前端日期数据传递到后台:数据格式转化,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1326字,纯文字阅读大概需要2分钟。
内容图文
如下图所示,ExtJS 代码:
var tb1 = Ext.create('Ext.toolbar.Toolbar', { region: 'north', border: '0 0 0 0', height: 34 }); tb1.add( { xtype: 'datefield', id: 'theDate', editable: false, labelWidth: 65, labelAlign: 'right', fieldLabel: '日期', width: 180, format: 'Y-m-d', listeners: { render: function (ee) { ee.setValue(Ext.Date.parse(Ext.Date.format(new Date(), 'Y-m') + "-01", 'Y-m-d')); } } }, { xtype: 'checkbox', id: 'isWholeMonth', hideLabels: true, boxLabel: '全月', checked: false, listeners: { change: function (cb, newValue, oldValue, obj) { var theMonth = Ext.getCmp("theDate"); theMonth.setDisabled(newValue); } } }, '->', { xtype: 'splitbutton', text: '查询', width: 70, handler: function () { btnOKClick(); }, menu: [ { icon: '../Public/Images/excel.png', text: '导出到Excel', handler: function () { ExportToExcel(); } } ] }, ' ', ' ' );
将前端日期数据传递到后台:
var timeBegin = Ext.getCmp('theDate').getValue(); var check = Ext.getCmp('isWholeMonth').getValue(); Ext.Ajax.request({ url: "EquipmentEnergyInfo.aspx?method=GetOneEquipmentParam", method: 'POST', params: { ariId: theId, typeAriId: tootSelected, timeBegin: Ext.Date.format(timeBegin, 'Y-m-d'), check: check, } });
后端接受:
string time = Request["timeBegin"];
相关文章:
英文日期格式 数据库的日期格式转换
JS 字符串转日期格式 日期格式化字符串
相关视频:
前端开发规范手册
以上就是ExtJS 前端日期数据传递到后台:数据格式转化的详细内容,更多请关注Gxl网其它相关文章!
内容总结
以上是互联网集市为您收集整理的ExtJS前端日期数据传递到后台:数据格式转化全部内容,希望文章能够帮你解决ExtJS前端日期数据传递到后台:数据格式转化所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。