1.数据提交的{}数据需转化json格式

syncPost('/controller/action', { values: JSON.stringify({d:x}) }, function (res) {
if (res.Data&&res.Data.Status || res.Status) {
E('PopupContainer').dxPopup('instance').hide();
if (E(gridId).html().length > 0) {//
E(gridId).dxDataGrid('instance').refresh();
}
} else {
errNotify("重复添加");
}
}, function (err) {
errNotify("不能重复添加");
});

2.时间控件联动写法

   window.startDateBox = $('#start').dxDateBox({
acceptCustomValue: false,
displayFormat: __DateFormat,
min: window.startDate,//限定时间值
onValueChanged: function (e) {
E('end').dxDateBox('instance').option("min", e.component.option("value"));//开始时间选择变化结束时间的最小值修改
}
}).dxDateBox('instance');
window.endDateBox = $('#end').dxDateBox({
acceptCustomValue: false,
displayFormat: __DateFormat,
max: window.endDate//限定时间值
}).dxDateBox('instance');

3.popup自定义弹出配置

   var popup = dxConfig.popup("选择信息");
popup.width = 900;
popup.height = 600;
popup.contentTemplate = function (container) {
var grid = initGrid("/getinfo", "popup_info", cityid, 2);//popup_info跟下面追加的div的id对应
container.append($('<div id="popup_info"/>').css({ "height": "90%" }).dxDataGrid(grid));
container.append($('<div id="plan-form"><div class="dx-fieldset" >\
<div class="row"><div class="col-sm-4 col-lg-4"> <div class="dx-field">\
<div class="dx-field-label">内容</div>\
<div class="dx-field-value" style="margin-left:-10%;width:70%; border:1px solid #eee;">\
<input autocomplete="off" readonly class="dx-texteditor-input" role="textbox" type="text" id="name">\
</div></div> </div>\
<div class="col-sm-4 col-lg-4"><div class="dx-field">\
<div class="dx-field-label">开始日期</div>\
<div class="dx-field-value">\
<div id="start"></div>\
</div></div></div>\
<div class="col-sm-4 col-lg-4">\
<div class="dx-field">\
<div class="dx-field-label">结束日期</div>\
<div class="dx-field-value"> <div id="end"></div>\
</div></div></div>\
</div></div ></div >'));
};//弹出框中添加确定和取消按钮
popup.toolbarItems = [
{
toolbar: 'bottom',
widget: 'dxButton',
options: {
text: '确定',
elementAttr: {
'style': 'background-color:#1BBC9B;color:white;'
},
icon: 'fa fa-save',
hoverStateEnabled: true,
onClick: function (e) {
var StartDate = window.startDateBox._options.value ? startDateBox._options.value : null;
var EndDate = window.endDateBox._options.value ? endDateBox._options.value : null;
var stagename = $("#name").val();
if (!stagename) {
errNotify("请选择内容");
return;
}
if (!StartDate) {
errNotify("请选择开始时间");
return;
}
if (!EndDate) {
errNotify("请选择结束时间");
return;
}
window.SelectAddData.StartDate = StartDate;
window.SelectAddData.EndDate = EndDate;
syncPost('/controller/Insert', { values: JSON.stringify({d:x}) }, function (res) {
if (res.Data&&res.Data.Status || res.Status) {
E('PopupToolsContainer').dxPopup('instance').hide();
if (E(gridId).html().length > 0) {//
E(gridId).dxDataGrid('instance').refresh();
}
} else {
errNotify("该不能重复添加");
}
}, function (err) {
errNotify("不能重复添加");
});
//if (typeof (fn) == "function")
// fn(e);
//E('PopupToolsContainer').dxPopup('instance').hide();
}
},
location: 'after'
}, {
toolbar: 'bottom',
widget: 'dxButton',
options: {
text: '取消',
icon: 'fa fa-undo',
hoverStateEnabled: true,
onClick: function () {
E('PopupToolsContainer').dxPopup('instance').hide();
}
},
location: 'after'
}
];
popup.onHidden = function () {
if (typeof hiddenFunc == "function") hiddenFunc();
}
E("PopupToolsContainer").dxPopup(popup);

4.HttpGet传递数组参数,url会转换为以,号分割的字符串可后台转换为数组变例

DevExtreme学习笔记(一) DataGrid中数据提交注意事项的更多相关文章

  1. DevExtreme学习笔记(一) DataGrid中数据筛选

    config.filterRow = { visible: true, applyFilter: "auto" }; config.headerFilter = { visible ...

  2. DevExtreme学习笔记(一) DataGrid中MVC分析

    @(Html.DevExtreme().DataGrid() .ID("gridContainer") .DataSource(d => d .OData() .Url(&q ...

  3. DevExtreme学习笔记(一) DataGrid中注意事项

    1.阻止cell编辑 config.onEditorPreparing = function (e) { if (e.dataField === 'xx' && e.row.data. ...

  4. DevExtreme学习笔记(一) DataGrid中js分析

    1.overviewjs采用 $(function() { $("#gridContainer").dxDataGrid({ dataSource: { store: { type ...

  5. CockroachDB学习笔记——[译]CockroachDB中的SQL:映射表中数据到键值存储

    CockroachDB学习笔记--[译]CockroachDB中的SQL:映射表中数据到键值存储 原文标题:SQL in CockroachDB: Mapping Table Data to Key- ...

  6. R学习笔记(4): 使用外部数据

    来源于:R学习笔记(4): 使用外部数据 博客:心内求法 鉴于内存的非持久性和容量限制,一个有效的数据处理工具必须能够使用外部数据:能够从外部获取大量的数据,也能够将处理结果保存.R中提供了一系列的函 ...

  7. .NET MVC 学习笔记(六)— 数据导入

    .NET MVC 学习笔记(六)—— 数据导入 在程序使用过程中,有时候需要新增大量数据,这样一条条数据去Add明显不是很友好,这时候最好就是有一个导入功能,导入所需要的数据,下面我们就一起来看一下导 ...

  8. Kotlin学习笔记(9)- 数据类

    系列文章全部为本人的学习笔记,若有任何不妥之处,随时欢迎拍砖指正.如果你觉得我的文章对你有用,欢迎关注我,我们一起学习进步! Kotlin学习笔记(1)- 环境配置 Kotlin学习笔记(2)- 空安 ...

  9. openresty 学习笔记二:获取请求数据

    openresty 学习笔记二:获取请求数据 openresty 获取POST或者GET的请求参数.这个是要用openresty 做接口必须要做的事情.这里分几种类型:GET,POST(urlenco ...

随机推荐

  1. 【0521模拟赛】小Z爱划水

    题目描述 小Z和其它机房同学都面临一个艰难的抉择,那就是 要不要划水? 每个人都有自己的一个意见,有的人想做题,有的人想划水. 当然,每个人只能选择一个事情做.如果一个人做的事情和他想做的不同,那么他 ...

  2. magento2重写virtualType并且传参

    今天遇到一个需求需要重写一个block,但是这个block是应用virtualType实现,所以需要先重写virtualType,然后却因为参数丢失而获取不到正确的结果.因此,查阅文档,需要用type ...

  3. SSL 安全协议 以及 如何认证

    目录 ssl安全协议 以及 认证 什么是协议 http劫持 ssl是什么 ssl 证书 概念 3种类型ssl 证书 ssl认证:阿里云免费认证 配置 Nginx的ssl认证 nginx的ssl证书(一 ...

  4. IntelliJ IDEA Check out from git

    点击check out from vesion control 填写git地址,test,clone

  5. openstackx

  6. Oracle 优化SQL

    https://www.cnblogs.com/ios9/p/8012611.html 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2 ...

  7. SQL server 表结构转Oracle SQL脚本

    SQL server 表结构转Oracle SQL脚本 /****** Object: StoredProcedure [dbo].[getOracle] Script Date: 2019/7/25 ...

  8. 012 spring retry重试原理的解析

    有点复杂,在后续的章节,将会对其中涉及到的知识点,再分章节进行说明. 1.程序结构 2.@Retryable package com.jun.web.annotation.theory; import ...

  9. Java架构师之路(参考这个学习吧)

  10. Eclipse新项目检出后报错第一步:导入lib中的jar包【我】

    新检出项目报错,第一步,先看项目 web-info下的 lib目录里的包是不是都添加到项目构建中了,可以全选先添加到项目构建中,看项目是否还在报错.