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. ELK:使用docker搭建elk平台

    1.安装ElasticSearch 1.docker pull elasticsearch //拉取镜像 2.find /var/lib/docker/overlay2/ -name jvm.opti ...

  2. 软件工程第二次作业——Java学习路线

    我的第二次软工作业 过去我对自己所学和想学都很迷茫,以至于学得总是一知半解,但现在我想主攻Java方向,并坚定不移地走下去(之后拓展其他方面就是以后的事情了).之所以想主攻Java方向是因为Java本 ...

  3. Linux系统学习(一)一Linux介绍

    一.Linux初识 1.1 Linux是什么 Linux是一种自由和开放源码的类UNIX操作系统,使用Linux内核.目前存在着许多不同的Linux发行版,可安装在各种各样的电脑硬件设备,从手机.平板 ...

  4. uniapp - 关于ios调试

    [ios调试] 1.一台windows电脑.一根apple数据线(一旦连接以后,apple设备就会自动识别itunes软件,如果没有安装会提示) 2.安装itunes (爱思助手) 3.官方教程:ht ...

  5. 清理收藏夹中的CSS

    1.去掉元素的属性, 例如宽度 #blog-calendar { width: initial !important; }

  6. UltraEdit 的“查看方式”着色类项型

    UltraEdit 的“查看方式”着色类项型 2011年06月22日 13:16:00 cnki_ok 阅读数 5722   版权声明:本文为博主原创文章,遵循CC 4.0 by-sa版权协议,转载请 ...

  7. Java JDBC利用反射技术将查询结果封装为对象

    1.JDBC将返回结果集封装成对象demo class JdbcDemo { /** * 获取数据库列名 * @param rs * @return */ private static String[ ...

  8. Gan-based zero-shot learning 论文整理

    1 Feature Generating Networks for Zero-Shot Learning Suffering from the extreme training data imbala ...

  9. CDH集群手动导入scm库

    一.手动导入 scm 库 背景:正常安装 cloudera-scm-server 时,安装 scm 库是通过脚本 /usr/share/cmf/schema/scm_prepare_database. ...

  10. [简短问答]lodop打印过慢或有进度条

    问法1:打印预览显示进度条,过慢出现进度条,打印过慢,可能和很多原因有关:打印内容或样式或图片等过多,有需要下载有脚步执行或本身网络慢:机器性能过低 系统ie有问题或缓存过多:或使用的是共享打印机.如 ...