DevExtreme 学习应用[3]
DevExtreme dxSelectBox 联动查询案例
//数据获取
lookupDataSource = new DevExpress.data.DataSource({
store: storeInitValue, //数据源
sort: { getter: "time", desc: true }, //排序
filter: ["ProjectKey", "=", Application1.ProjectKey], //过滤
map: function (item) {
return new ini_valueViewModel(item);
}
}); //数据更新
function handleDataSourceChanged() {
isReady.resolve();
lookupDataSource.off("changed", handleDataSourceChanged);
}
lookupDataSource.on("changed", handleDataSourceChanged); return {
typedatasourceChange: function (e) {
//从新更新数据
lookupDataSource.filter([["ProjectKey", "=", Application1.ProjectKey], '&&', ["TypeName", "=", e.value]]);
lookupDataSource.reload();
//数据重新加载
},
typedatasource: typedatasource, //类型
lookupDataSource: lookupDataSource, //名称
control: control,
handleSave: handleSave,
handleCancel: handleCancel,
viewShowing: handleViewShowing,
isReady: isReady.promise()
};
<div data-options="dxView : { name: 'ControlEdit', mode: 'edit', title: '测点设置' } ">
<div data-bind="dxCommand: { onExecute: handleSave, id: 'save', title: 'Save', icon: 'save' } "></div>
<div data-bind="dxCommand: { onExecute: handleCancel, id: 'cancel', behavior: 'back', title: 'Cancel', icon: 'close' }"></div>
<div data-options="dxContent : { targetPlaceholder: 'content' } " class="dx-edit-view dx-content-background dx-form-background" data-bind="dxDeferRendering: { showLoadIndicator: true, staggerItemSelector: '.dx-field', animation: 'edit-item-rendered', renderWhen: isReady }">
<div data-bind="dxScrollView: { }">
<div class="dx-fieldset">
<div class="dx-field">
<div class="dx-field-label">测点类型: </div>
<div data-bind="dxSelectBox:{
dataSource: typedatasource,
placeholder: '测点分类',
displayExpr: 'Name',
valueExpr: 'TableName',
value: control.TypeName,
onValueChanged:typedatasourceChange}">
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">测点名称: </div>
<div data-bind="dxSelectBox:{
dataSource: lookupDataSource,
placeholder: '测点编号',
displayExpr: 'name',
valueExpr: 'name',
value: control.name}">
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">控制值: </div>
<div class="dx-field-value" data-bind="dxNumberBox: { value: control.WarningUp, placeholder: '控制值' }"></div>
</div>
<div class="dx-field">
<div class="dx-field-label">报警值: </div>
<div class="dx-field-value" data-bind="dxNumberBox: { value: control.EarlyWarningUp, placeholder: '报警值' }"></div>
</div>
</div>
</div>
</div>
</div>

DevExtreme 学习应用[3]的更多相关文章
- DevExtreme 学习应用[2]
DevExtreme 学习应用[2] 调用WebService数据 1那么首先建立WebService using System; using System.Collections.Generic; ...
- DevExtreme 学习应用[1]
DevExtreme学习开发 [1] 用HTML开发手机应用,看一哈帮助文档觉得还很不错. 在开发前一定要安装DevExteme 下载连接地址: ftp://211.101.1.108/DevExp ...
- DevExtreme学习笔记(一) DataGrid中MVC分析
@(Html.DevExtreme().DataGrid() .ID("gridContainer") .DataSource(d => d .OData() .Url(&q ...
- DevExtreme学习笔记(一)treeView(搜索固定、节点展开和收缩)注意事项
var treeConfig1 = dxConfig.treeView(obj_Question.treeDataSource1); treeConfig1.selectionMode = 'sing ...
- DevExtreme学习笔记(一) DataGrid中数据提交注意事项
1.数据提交的{}数据需转化json格式 syncPost('/controller/action', { values: JSON.stringify({d:x}) }, function (res ...
- DevExtreme学习笔记(一) DataGrid中数据筛选
config.filterRow = { visible: true, applyFilter: "auto" }; config.headerFilter = { visible ...
- DevExtreme学习笔记(一) DataGrid中注意事项
1.阻止cell编辑 config.onEditorPreparing = function (e) { if (e.dataField === 'xx' && e.row.data. ...
- DevExtreme学习笔记(一) DataGrid中js分析
1.overviewjs采用 $(function() { $("#gridContainer").dxDataGrid({ dataSource: { store: { type ...
- ABP 基于DDD的.NET开发框架 学习(五)中使用DevExpress插件
1.DevExpress安装 安装步骤1:开始安装 安装步骤2:选择需要安装的模块 安装步骤3:修改安装路径 安装步骤4:正在安装 安装步骤5:安装完成 2.Vs中设置 1)DevExtremeBun ...
随机推荐
- 51Nod 1003 阶乘后面0的数量(数学,思维题)
1003 阶乘后面0的数量 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 n的阶乘后面有多少个0? 6的阶乘 = 1*2*3*4*5*6 = 720 ...
- [bzoj2638] 黑白染色
比较蛋疼的是我们可以先染个底色,再在底色上染别的东西. 由ccz大爷的题解可得..将目标状态里相同颜色的联通块缩点后,枚举起点,生成树里的最大节点深度就是需要的次数了, 如果最大深度是白色的话记得-1 ...
- HDU-5421Victor and String
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5421 因为要在前面插字符,所以维护一个前缀链和后缀链,在同一棵回文树上搞,如果有某个最长回文后缀(或前缀) ...
- 自制ZigBee协议分析仪
关键词 ZigBee Sniffer 协议 分析仪 自制 CC2530 CC2531 在开发ZigBee / Bluetooth的过程,难免会要用到Sniffer工具,Packet Sni ...
- 如何更改Linux的ssh端口
1. 修改/etc/ssh/sshd_config里的Port字段 Port 22改为Port 1000(你自定义的端口) 2. 重启sshd服务 #service sshd restart
- javascript如何自动去除所有空格?
1.jquery自带了trim方法: $.trim(" abc ") // abc 2.自己写方法: function trim(str) { return str.repl ...
- 顺序一致性内存模型与JMM的“顺序一致性”
顺序一致性内存模型是一个被计算机科学家理想化了的理论参考模型,它为程序员提供了极强的内存可见性保证.顺序一致性内存模型有两大特性.1)一个线程中的所有操作必须按照程序的顺序来执行.2)(不管程序是否同 ...
- CentOS 7安装
使用U盘安装 1.CentOS 7系统镜像制作U盘启动盘 1).下载CentOS 7系统镜像 下载地址:http://mirrors.aliyun.com/centos/7/isos/x86_64/ ...
- Spring MVC 用post方式提交表单到Controller乱码问题,而get方式提交没有乱码问题
在web.xml中添加一个filter,即可解决post提交到Spring MVC乱码问题 <!-- 配置请求过滤器,编码格式设为UTF-8,避免中文乱码--> <filter> ...
- 2017-06-22(locate shutdown half poweroff init0 reboot init 6)
locate locate 文件搜索命令 格式:locate [文件名] locate 在后台数据库中(/var/lib/mlocate/mlocate.db)按文件名搜索,速度快 刚刚新建的文件, ...