最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

ExtJS前端日期数据传递到后台:数据格式转化

来源:动视网 责编:小采 时间:2020-11-27 19:32:59
文档

ExtJS前端日期数据传递到后台:数据格式转化

ExtJS前端日期数据传递到后台:数据格式转化:如下图所示,ExtJS 代码: var tb1 = Ext.create('Ext.toolbar.Toolbar', { region: 'north', border: '0 0 0 0', height: 34 }); tb1.add( { xtype: 'datefield',
推荐度:
导读ExtJS前端日期数据传递到后台:数据格式转化:如下图所示,ExtJS 代码: var tb1 = Ext.create('Ext.toolbar.Toolbar', { region: 'north', border: '0 0 0 0', height: 34 }); tb1.add( { xtype: 'datefield',
 如下图所示,

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前端日期数据传递到后台:数据格式转化

ExtJS前端日期数据传递到后台:数据格式转化:如下图所示,ExtJS 代码: var tb1 = Ext.create('Ext.toolbar.Toolbar', { region: 'north', border: '0 0 0 0', height: 34 }); tb1.add( { xtype: 'datefield',
推荐度:
标签: 转换 格式 转换成
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top