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. Tkinter 之爬虫框架项目实战

    一.效果图 二.源码 ''' 测试内容页爬取''' def test_content_url(self): try: url = self.test_url_var.get().strip() ite ...

  2. java web开发及Servlet常用的代码

    日志 1.使用门面模式的slfj,并结合log4j,logback. 2.info.debug.error,要写清楚. 3.使用占位符,如下: log.info("用户id为: {} &qu ...

  3. 设置应用程序的样式并对其进行部署——《Python编程从入门到实践》

    我们将使用应用程序django-bootstrap3为Web应用程序设计样式.我们将把项目"学习笔记"部署到Heroku,这个网站能让我们们将项目推送到其服务器,让任何有网络连接的 ...

  4. java中JSON转含泛型对象

    public static void main(String[] args) { UserDto userDto=new UserDto("test","14" ...

  5. MetaPruning: Meta Learning for Automatic Neural Network Channel Pruning

    MetaPruning: Meta Learning for Automatic Neural Network Channel Pruning 2019-08-11 19:48:17 Paper: h ...

  6. mysql索引原理及优化(二)

    索引原理分析:数据结构 索引是最常见的慢查询优化方式其是一种优化查询的数据结构,MySql中的索引是用B+树实现,而B+树就是一种数据结构,可以优化查询速度,可以利用索引快速查找数据,优化查询. 可以 ...

  7. 集群服务器+定时任务(Quartz) 重复执行的问题

    x StackExchange.Redis private readonly IDatabase _db; string key = string.Concat("{自己命名的Redis前缀 ...

  8. jenkins中启用tag标签

    参照里面的第9步: https://www.cnblogs.com/effortsing/p/10468840.html

  9. [LeetCode] 200. Number of Islands 岛屿的数量

    Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surro ...

  10. Django文档阅读之执行原始SQL查询

    Django提供了两种执行原始SQL查询的方法:可以使用Manager.raw()来执行原始查询并返回模型实例,或者可以完全避免模型层直接执行自定义SQL. 每次编写原始SQL时都要关注防止SQL注入 ...