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 ...
随机推荐
- 浅谈Windows环境下DOS及MS-DOS以及常见一些命令的介绍
浅谈Windows环境下DOS及MS-DOS以及常见一些命令的介绍 前记 自己是搞编程的,首先我是一个菜鸟,接触计算机这么久了,感觉很多计算机方面的技术和知识朦朦胧胧.模模糊糊,貌似有些贻笑大方了:所 ...
- [51nod1671]货物运输
公元2222年,l国发生了一场战争. 小Y负责领导工人运输物资. 其中有m种物资的运输方案,每种运输方案形如li,ri.表示存在一种货物从li运到ri. 这里有n个城市,第i个城市与第i+1个城市相连 ...
- RabbitMQ 使用demo
1.新建一个控制台应用程序:如图 2.代码如下: using RabbitMQ.Client;using RabbitMQ.Client.Events;using System;using Syste ...
- 你必须知道的session与cookie
Session本质 提到Session我们能联想到的就是用户登录功能,而本身我们使用Session的基础是通过url进行访问的,也就是使用http协议进行访问的,而http协议本身是无状态的,那么问题 ...
- 【学习笔记】js下拉刷新、上拉加载 mescroll框架的使用
写在前边: 工作需要,使用ajax在原来的列表下边使用ajax请求后台数据,拼接在列表最下边,在github转了好久,发现了一个bug极多的js刷新插件,尝试了一个下午,就在快放弃的时候,发现下边有留 ...
- 怎么知道我的laravel 是几版本的
方法1: 使用php artisan --version ,只要能看懂这个命令的人一定已经具有初步的Laravel知识. 再介绍一种不需要命令,直接去文件中去查看的方法. 方法2: 在项目文件中找ve ...
- 浅谈mysql innodb缓存策略
浅谈mysql innodb缓存策略: The InnoDB Buffer Pool Innodb 持有一个存储区域叫做buffer pool是为了在内存中缓存数据和索引,知道innodb buffe ...
- JVM-垃圾收集的过程
JDK1.7 JVM的垃圾收集算法有 1. 标记-清除算法: 2. 复制算法:在商业虚拟机都是使用这种算法来回收新生代的 3. 标记-整理算法: JDK1.7 JVM的垃圾收集器有 1. Serial ...
- apache (order allow,deny or deny,allow)
平台:"rhel6.2" 实验内容: "测试apache‘order allow,deny’ or ‘order deny,allow’ 功能" 配置文件:&q ...
- dBm与Vpp相互转换公式
dBm = 10 + 20lg(0.5Vpp) Vpp = 2x10 以上公式均为阻抗为50欧的情况下计算得出的